[ofw] Memory leaks in opensm

Smith, Stan stan.smith at intel.com
Mon Dec 5 10:03:08 PST 2011


Hello,
  Please see inline comments.

From: Leonid Keller [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 ?

Yes - it's good to fix these; will do so.

In the larger picture, these leaks are not Earth shaking in that system integrity is not compromised as we are talking about 512 bytes allocated once during opensm startup.
Nonetheless, any memory leaks should be fixed!
What tool and tool invocation did you use to discover the memory leak, file and line #?

Stan.

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/20111205/97086cba/attachment.html>


More information about the ofw mailing list