[ofw] Memory leaks in opensm
Smith, Stan
stan.smith at intel.com
Tue Dec 6 17:18:31 PST 2011
Committed the following Windows specific patch to fix the strdup() during initialization memory leaks. Will revisit after RoCE merge using reworked memory tracking code.
When all memory leaks are understood, will push upstream for consideration.
Signed-off-by: stan.smith at intel.com<mailto:stan.smith at intel.com>
Revision: 3361
Author: stan.smith at intel.com
Date: Tuesday, December 06, 2011 5:12:23 PM
Message:
[OPENSM] fixed the strdup() memory leaks. revisit after RoCE merge.
----
Modified : /gen1/trunk/ulp/opensm/user/opensm/osm_subnet.c
--- ulp/opensm/user/opensm/osm_subnet.c Fri Oct 07 14:12:56 2011
+++ ulp/opensm/user/opensm/osm_subnet.c Tue Dec 06 14:53:31 2011
@@ -526,6 +526,13 @@
cl_list_item_t *item = cl_qlist_remove_head(&p_subn->prefix_routes_list);
free(item);
}
+ free( p_subn->opt.partition_config_file );
+ free( p_subn->opt.dump_files_dir );
+ free( p_subn->opt.console );
+ free( p_subn->opt.log_file );
+ free( p_subn->opt.qos_policy_file );
+ free( p_subn->opt.torus_conf_file );
+ free( p_subn->opt.prefix_routes_file );
}
ib_api_status_t osm_subn_init(IN osm_subn_t * p_subn, IN osm_opensm_t * p_osm,
From: Leonid Keller [mailto:leonid at mellanox.com]<mailto:[mailto:leonid at mellanox.com]>
Sent: Monday, December 05, 2011 6:32 AM
To: Shahaf Zor; Smith, Stan; Hefty, Sean
Cc: ofw_list
Subject: Memory leaks in opensm
Ø [3140] Memory block at 000000C109136DC0 of size 0x200 allocated in file winosm_common.c line 138
osm_subn_set_default_opt() contains line
p_opt->torus_conf_file = strdup(OSM_DEFAULT_TORUS_CONF_FILE);
which contains macro OSM_DEFAULT_TORUS_CONF_FILE
#define OSM_DEFAULT_TORUS_CONF_FILE strcat(GetOsmCachePath(), "osm-torus-2QoS.conf")
which calls GetOsmCachePath(), which allocates path which is never released.
Also the results of strdup() are never released.
Is it of any interest ?
From: Shahaf Zor
Sent: Monday, December 05, 2011 1:11 PM
To: Irena Gannon; Gilad Margalit; Win_dev_qa
Cc: sw_net_windows; Sharon Cohen
Subject: RE: Debuggers Status
I get this on closing opensm:
[3140] Assertion Failed:FALSE
[3140]
[3140]
[3140]
[3140] *** Memory Usage ***
[3140] Memory block at 000000C10912E320 of size 0x10 allocated in file ..\cl_pool.c line 108
[3140] Memory block at 000000C10912E340 of size 0x10 allocated in file ..\cl_pool.c line 108
[3140] Memory block at 000000C10912E360 of size 0x10 allocated in file ..\cl_pool.c line 108
[3140] Memory block at 000000C10912E400 of size 0x10 allocated in file ..\cl_pool.c line 108
[3140] Memory block at 000000C10912E4A0 of size 0x10 allocated in file ..\cl_pool.c line 108
[3140] Memory block at 000000C10912E520 of size 0x10 allocated in file ..\cl_pool.c line 108
[3140] Memory block at 000000C10912E540 of size 0x10 allocated in file ..\cl_pool.c line 108
[3140] Memory block at 000000C109130FD0 of size 0x20 allocated in file ..\cl_ptr_vector.c line 205
[3140] Memory block at 000000C109131000 of size 0x20 allocated in file ..\cl_ptr_vector.c line 205
[3140] Memory block at 000000C109135B20 of size 0x30 allocated in file ..\cl_threadpool.c line 141
[3140] Memory block at 000000C109135B60 of size 0x30 allocated in file ..\cl_threadpool.c line 141
[3140] Memory block at 000000C109135BA0 of size 0x30 allocated in file ..\cl_threadpool.c line 141
[3140] Memory block at 000000C109136DC0 of size 0x200 allocated in file winosm_common.c line 138
[3140] Memory block at 000000C109139050 of size 0x5818 allocated in file ..\cl_pool.c line 247
[3140] Memory block at 000000C10913E9F0 of size 0x298 allocated in file ..\cl_pool.c line 247
[3140] Memory block at 000000C10913F290 of size 0x30 allocated in file ..\cl_threadpool.c line 141
[3140] Memory block at 000000C10913FCA0 of size 0x30 allocated in file ..\cl_threadpool.c line 141
[3140] Memory block at 000000C10913FEB0 of size 0x30 allocated in file ..\cl_threadpool.c line 141
[3140] Memory block at 000000C10913FF30 of size 0x30 allocated in file ..\cl_threadpool.c line 141
[3140] Memory block at 000000C10913FFF0 of size 0x30 allocated in file ..\cl_threadpool.c line 141
[3140] Memory block at 000000C109140030 of size 0x30 allocated in file ..\cl_threadpool.c line 141
[3140] Memory block at 000000C1091400F0 of size 0x30 allocated in file ..\cl_threadpool.c line 141
[3140] Memory block at 000000C109140130 of size 0x30 allocated in file ..\cl_threadpool.c line 141
[3140] Memory block at 000000C109140170 of size 0x30 allocated in file ..\cl_threadpool.c line 141
[3140] Memory block at 000000C1091401F0 of size 0x30 allocated in file ..\cl_threadpool.c line 141
[3140] Memory block at 000000C1091402B0 of size 0x30 allocated in file ..\cl_threadpool.c line 141
[3140] Memory block at 000000C1091405B0 of size 0x30 allocated in file ..\cl_threadpool.c line 141
[3140] Memory block at 000000C1091405F0 of size 0x30 allocated in file ..\cl_threadpool.c line 141
[3140] Memory block at 000000C109145690 of size 0x800 allocated in file ..\cl_ptr_vector.c line 205
[3140] Memory block at 000000C10914D380 of size 0x78 allocated in file ..\cl_pool.c line 247
[3140] Memory block at 000000C10914D980 of size 0x78 allocated in file ..\cl_pool.c line 247
[3140] Memory block at 000000C10914E5C0 of size 0x180 allocated in file ..\cl_ptr_vector.c line 205
[3140] Memory block at 000000C109153330 of size 0xe0 allocated in file ..\cl_pool.c line 247
[3140] Memory block at 000000C109160370 of size 0x8 allocated in file ..\cl_ptr_vector.c line 205
[3140] Memory block at 000000C1091603C0 of size 0x8 allocated in file ..\cl_ptr_vector.c line 205
[3140] Memory block at 000000C1091603F0 of size 0x8 allocated in file ..\cl_ptr_vector.c line 205
[3140] Memory block at 000000C109160400 of size 0x8 allocated in file ..\cl_ptr_vector.c line 205
[3140] Memory block at 000000C109160450 of size 0xc18 allocated in file ..\cl_pool.c line 247
[3140] Memory block at 000000C109162200 of size 0xc18 allocated in file ..\cl_pool.c line 247
[3140] *** End of Memory Usage ***
[3140]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20111207/3ce43575/attachment.html>
More information about the ofw
mailing list