<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Plain Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.5pt;
font-family:Consolas;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
span.PlainTextChar
{mso-style-name:"Plain Text Char";
mso-style-priority:99;
mso-style-link:"Plain Text";
font-family:Consolas;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
span.EmailStyle22
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle23
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle24
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle25
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle26
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:904220405;
mso-list-type:hybrid;
mso-list-template-ids:-2068545520 1263437308 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
{mso-level-start-at:2;
mso-level-number-format:bullet;
mso-level-text:\F0D8;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;
mso-fareast-font-family:Calibri;
mso-bidi-font-family:Arial;}
@list l0:level2
{mso-level-tab-stop:1.0in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level3
{mso-level-tab-stop:1.5in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level4
{mso-level-tab-stop:2.0in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level5
{mso-level-tab-stop:2.5in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level6
{mso-level-tab-stop:3.0in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level7
{mso-level-tab-stop:3.5in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level8
{mso-level-tab-stop:4.0in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level9
{mso-level-tab-stop:4.5in;
mso-level-number-position:left;
text-indent:-.25in;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Committed the following Windows specific patch to fix the strdup() during initialization memory leaks. Will revisit after RoCE merge using reworked memory tracking code.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">When all memory leaks are understood, will push upstream for consideration.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Signed-off-by: <a href="mailto:stan.smith@intel.com">
stan.smith@intel.com</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Revision: 3361<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Author: stan.smith@intel.com<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Date: Tuesday, December 06, 2011 5:12:23 PM<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Message:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[OPENSM] fixed the strdup() memory leaks. revisit after RoCE merge.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">----<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Modified : /gen1/trunk/ulp/opensm/user/opensm/osm_subnet.c<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span style="font-family:"Courier New"">--- ulp/opensm/user/opensm/osm_subnet.c Fri Oct 07 14:12:56 2011<o:p></o:p></span></p>
<p class="MsoPlainText"><span style="font-family:"Courier New"">+++ ulp/opensm/user/opensm/osm_subnet.c Tue Dec 06 14:53:31 2011<o:p></o:p></span></p>
<p class="MsoPlainText"><span style="font-family:"Courier New"">@@ -526,6 +526,13 @@<o:p></o:p></span></p>
<p class="MsoPlainText"><span style="font-family:"Courier New""> cl_list_item_t *item = cl_qlist_remove_head(&p_subn->prefix_routes_list);<o:p></o:p></span></p>
<p class="MsoPlainText"><span style="font-family:"Courier New""> free(item);<o:p></o:p></span></p>
<p class="MsoPlainText"><span style="font-family:"Courier New""> }<o:p></o:p></span></p>
<p class="MsoPlainText"><span style="font-family:"Courier New"">+ free( p_subn->opt.partition_config_file );<o:p></o:p></span></p>
<p class="MsoPlainText"><span style="font-family:"Courier New"">+ free( p_subn->opt.dump_files_dir );<o:p></o:p></span></p>
<p class="MsoPlainText"><span style="font-family:"Courier New"">+ free( p_subn->opt.console );<o:p></o:p></span></p>
<p class="MsoPlainText"><span style="font-family:"Courier New"">+ free( p_subn->opt.log_file );<o:p></o:p></span></p>
<p class="MsoPlainText"><span style="font-family:"Courier New"">+ free( p_subn->opt.qos_policy_file );
<o:p></o:p></span></p>
<p class="MsoPlainText"><span style="font-family:"Courier New"">+ free( p_subn->opt.torus_conf_file );<o:p></o:p></span></p>
<p class="MsoPlainText"><span style="font-family:"Courier New"">+ free( p_subn->opt.prefix_routes_file );
<o:p></o:p></span></p>
<p class="MsoPlainText"><span style="font-family:"Courier New""> }<o:p></o:p></span></p>
<p class="MsoPlainText"><span style="font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoPlainText"><span style="font-family:"Courier New"">ib_api_status_t osm_subn_init(IN osm_subn_t * p_subn, IN osm_opensm_t * p_osm,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Leonid Keller
<a href="mailto:[mailto:leonid@mellanox.com]">[mailto:leonid@mellanox.com]</a> <br>
<b>Sent:</b> Monday, December 05, 2011 6:32 AM<br>
<b>To:</b> Shahaf Zor; Smith, Stan; Hefty, Sean<br>
<b>Cc:</b> ofw_list<br>
<b>Subject:</b> Memory leaks in opensm<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo2"><![if !supportLists]><span style="font-family:Wingdings;color:#1F497D"><span style="mso-list:Ignore">Ø<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span style="color:#1F497D">[3140] Memory block at 000000C109136DC0 of size 0x200 allocated in file winosm_common.c line 138<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">osm_subn_set_default_opt() contains line<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="color:#1F497D"> p_opt->torus_conf_file = strdup(OSM_DEFAULT_TORUS_CONF_FILE);<o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">which contains macro OSM_DEFAULT_TORUS_CONF_FILE<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:.5in"><b><span style="color:#1F497D">#define OSM_DEFAULT_TORUS_CONF_FILE strcat(GetOsmCachePath(), "osm-torus-2QoS.conf")<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="color:#1F497D"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><span style="color:#1F497D">which calls GetOsmCachePath(), which allocates path which is
<span style="background:yellow;mso-highlight:yellow">never released</span>.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Also the results of strdup() are never released.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Is it of any interest ?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Shahaf Zor
<br>
<b>Sent:</b> Monday, December 05, 2011 1:11 PM<br>
<b>To:</b> Irena Gannon; Gilad Margalit; Win_dev_qa<br>
<b>Cc:</b> sw_net_windows; Sharon Cohen<br>
<b>Subject:</b> RE: Debuggers Status<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">I get this on closing opensm:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Assertion Failed:FALSE<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] *** Memory Usage ***<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C10912E320 of size 0x10 allocated in file ..\cl_pool.c line 108<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C10912E340 of size 0x10 allocated in file ..\cl_pool.c line 108<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C10912E360 of size 0x10 allocated in file ..\cl_pool.c line 108<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C10912E400 of size 0x10 allocated in file ..\cl_pool.c line 108<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C10912E4A0 of size 0x10 allocated in file ..\cl_pool.c line 108<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C10912E520 of size 0x10 allocated in file ..\cl_pool.c line 108<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C10912E540 of size 0x10 allocated in file ..\cl_pool.c line 108<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C109130FD0 of size 0x20 allocated in file ..\cl_ptr_vector.c line 205<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C109131000 of size 0x20 allocated in file ..\cl_ptr_vector.c line 205<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C109135B20 of size 0x30 allocated in file ..\cl_threadpool.c line 141<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C109135B60 of size 0x30 allocated in file ..\cl_threadpool.c line 141<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C109135BA0 of size 0x30 allocated in file ..\cl_threadpool.c line 141<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C109136DC0 of size 0x200 allocated in file winosm_common.c line 138<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C109139050 of size 0x5818 allocated in file ..\cl_pool.c line 247<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C10913E9F0 of size 0x298 allocated in file ..\cl_pool.c line 247<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C10913F290 of size 0x30 allocated in file ..\cl_threadpool.c line 141<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C10913FCA0 of size 0x30 allocated in file ..\cl_threadpool.c line 141<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C10913FEB0 of size 0x30 allocated in file ..\cl_threadpool.c line 141<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C10913FF30 of size 0x30 allocated in file ..\cl_threadpool.c line 141<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C10913FFF0 of size 0x30 allocated in file ..\cl_threadpool.c line 141<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C109140030 of size 0x30 allocated in file ..\cl_threadpool.c line 141<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C1091400F0 of size 0x30 allocated in file ..\cl_threadpool.c line 141<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C109140130 of size 0x30 allocated in file ..\cl_threadpool.c line 141<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C109140170 of size 0x30 allocated in file ..\cl_threadpool.c line 141<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C1091401F0 of size 0x30 allocated in file ..\cl_threadpool.c line 141<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C1091402B0 of size 0x30 allocated in file ..\cl_threadpool.c line 141<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C1091405B0 of size 0x30 allocated in file ..\cl_threadpool.c line 141<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C1091405F0 of size 0x30 allocated in file ..\cl_threadpool.c line 141<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C109145690 of size 0x800 allocated in file ..\cl_ptr_vector.c line 205<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C10914D380 of size 0x78 allocated in file ..\cl_pool.c line 247<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C10914D980 of size 0x78 allocated in file ..\cl_pool.c line 247<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C10914E5C0 of size 0x180 allocated in file ..\cl_ptr_vector.c line 205<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C109153330 of size 0xe0 allocated in file ..\cl_pool.c line 247<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C109160370 of size 0x8 allocated in file ..\cl_ptr_vector.c line 205<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C1091603C0 of size 0x8 allocated in file ..\cl_ptr_vector.c line 205<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C1091603F0 of size 0x8 allocated in file ..\cl_ptr_vector.c line 205<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C109160400 of size 0x8 allocated in file ..\cl_ptr_vector.c line 205<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C109160450 of size 0xc18 allocated in file ..\cl_pool.c line 247<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] Memory block at 000000C109162200 of size 0xc18 allocated in file ..\cl_pool.c line 247<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140] *** End of Memory Usage ***<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">[3140]<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>