<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: malloc/free debugging in a C code! in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700657#M902187</link>
    <description>There is a memory tool available called electric fence. This is nowhere near as good as Purify. It's a freeware tool that I have used specifically to hunt down problems with malloc on HPUX.&lt;BR /&gt;&lt;BR /&gt;Here's the skinny on it:&lt;BR /&gt;&lt;BR /&gt;ElectricFence is a utility for C programming and&lt;BR /&gt;debugging. ElectricFence uses the virtual memory hardware of your&lt;BR /&gt;system to detect when software overruns malloc() buffer boundaries,&lt;BR /&gt;and/or to detect any accesses of memory released by&lt;BR /&gt;free(). ElectricFence will then stop the program on the first&lt;BR /&gt;instruction that caused a bounds violation and you can use your&lt;BR /&gt;favorite debugger to display the offending statement.&lt;BR /&gt;&lt;BR /&gt;Install ElectricFence if you need a debugger to find malloc()&lt;BR /&gt;violations.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I'm not sure if it would work in a MPI environment.</description>
    <pubDate>Wed, 10 Apr 2002 22:16:47 GMT</pubDate>
    <dc:creator>Scott Van Kalken</dc:creator>
    <dc:date>2002-04-10T22:16:47Z</dc:date>
    <item>
      <title>malloc/free debugging in a C code!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700652#M902182</link>
      <description>Hi,&lt;BR /&gt;I have a multi-code C project running on HP V-Class machines using MPI. The code crashes for at some free() statements, althought the things i am trying to free() look fine under the totalview debugger i am using. For different problem sizes, it crashes at different free() locations. Can someone help me with this? Is there any tool available on HPUX to help me diagnose this problem?&lt;BR /&gt;I badly need this information as I have a few deadlines to meet. Thanks in advance!&lt;BR /&gt;Ravi&lt;BR /&gt;</description>
      <pubDate>Wed, 10 Apr 2002 09:17:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700652#M902182</guid>
      <dc:creator>Ravi Abrol</dc:creator>
      <dc:date>2002-04-10T09:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: malloc/free debugging in a C code!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700653#M902183</link>
      <description>Try Rational's Purify.&lt;BR /&gt;It's pretty good at detecting MLK (memory leaks) and FUM (Freeing unallocated memory)&lt;BR /&gt;&lt;A href="http://www.rational.com/products/purify_unix/index.jsp" target="_blank"&gt;http://www.rational.com/products/purify_unix/index.jsp&lt;/A&gt;</description>
      <pubDate>Wed, 10 Apr 2002 09:25:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700653#M902183</guid>
      <dc:creator>Deepak Extross</dc:creator>
      <dc:date>2002-04-10T09:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: malloc/free debugging in a C code!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700654#M902184</link>
      <description>Purify is also my recommendation, but if you want something free you might like to try this garbage collector from HP labs:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.hpl.hp.com/personal/Hans_Boehm/gc/" target="_blank"&gt;http://www.hpl.hp.com/personal/Hans_Boehm/gc/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;It contains replacements for the malloc and free routines and can also be used as a leak detector.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Steve</description>
      <pubDate>Wed, 10 Apr 2002 09:32:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700654#M902184</guid>
      <dc:creator>Steven Gillard_2</dc:creator>
      <dc:date>2002-04-10T09:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: malloc/free debugging in a C code!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700655#M902185</link>
      <description>well, u can get a free eval copy of Purify at&lt;BR /&gt;&lt;A href="http://www.rational.com/tryit/evals/purifyunix_eval.jsp" target="_blank"&gt;http://www.rational.com/tryit/evals/purifyunix_eval.jsp&lt;/A&gt;</description>
      <pubDate>Wed, 10 Apr 2002 09:35:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700655#M902185</guid>
      <dc:creator>Deepak Extross</dc:creator>
      <dc:date>2002-04-10T09:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: malloc/free debugging in a C code!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700656#M902186</link>
      <description>thanks deepak and steve,&lt;BR /&gt;i tried using purify, but it doesn't work with mpicc (multi-processor cc). the garbage collector is working with my code but it crashes my code at strange places. i will be trying it for the next few days to see how it goes. do you know of any other tools?&lt;BR /&gt;thanks,&lt;BR /&gt;ravi</description>
      <pubDate>Wed, 10 Apr 2002 20:08:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700656#M902186</guid>
      <dc:creator>Ravi Abrol</dc:creator>
      <dc:date>2002-04-10T20:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: malloc/free debugging in a C code!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700657#M902187</link>
      <description>There is a memory tool available called electric fence. This is nowhere near as good as Purify. It's a freeware tool that I have used specifically to hunt down problems with malloc on HPUX.&lt;BR /&gt;&lt;BR /&gt;Here's the skinny on it:&lt;BR /&gt;&lt;BR /&gt;ElectricFence is a utility for C programming and&lt;BR /&gt;debugging. ElectricFence uses the virtual memory hardware of your&lt;BR /&gt;system to detect when software overruns malloc() buffer boundaries,&lt;BR /&gt;and/or to detect any accesses of memory released by&lt;BR /&gt;free(). ElectricFence will then stop the program on the first&lt;BR /&gt;instruction that caused a bounds violation and you can use your&lt;BR /&gt;favorite debugger to display the offending statement.&lt;BR /&gt;&lt;BR /&gt;Install ElectricFence if you need a debugger to find malloc()&lt;BR /&gt;violations.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I'm not sure if it would work in a MPI environment.</description>
      <pubDate>Wed, 10 Apr 2002 22:16:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700657#M902187</guid>
      <dc:creator>Scott Van Kalken</dc:creator>
      <dc:date>2002-04-10T22:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: malloc/free debugging in a C code!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700658#M902188</link>
      <description>I also got this out of google&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.cs.colorado.edu/homes/zorn/public_html/MallocDebug.html" target="_blank"&gt;http://www.cs.colorado.edu/homes/zorn/public_html/MallocDebug.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;it's a neat overview of some tools.&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Scott.&lt;BR /&gt;</description>
      <pubDate>Wed, 10 Apr 2002 22:18:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700658#M902188</guid>
      <dc:creator>Scott Van Kalken</dc:creator>
      <dc:date>2002-04-10T22:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: malloc/free debugging in a C code!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700659#M902189</link>
      <description>hi scott,&lt;BR /&gt;thanks for the list and the intro on electric fence. i will certainly try to use some of them to see if they can work with my C code in MPI environment on HPUX. i tried running my code in the AIX environment on an IBM SP machine (to which i have only limited access) and these memory problems didn't occur there. &lt;BR /&gt;thanks again!&lt;BR /&gt;ravi</description>
      <pubDate>Thu, 11 Apr 2002 06:13:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700659#M902189</guid>
      <dc:creator>Ravi Abrol</dc:creator>
      <dc:date>2002-04-11T06:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: malloc/free debugging in a C code!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700660#M902190</link>
      <description>&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x316efd3f91d3d5118ff40090279cd0f9,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x316efd3f91d3d5118ff40090279cd0f9,00.html&lt;/A&gt;</description>
      <pubDate>Thu, 11 Apr 2002 06:18:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700660#M902190</guid>
      <dc:creator>Deepak Extross</dc:creator>
      <dc:date>2002-04-11T06:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: malloc/free debugging in a C code!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700661#M902191</link>
      <description>Maybe the mallinfo() and memorymap() functions&lt;BR /&gt;will be of some use.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;</description>
      <pubDate>Thu, 11 Apr 2002 19:03:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700661#M902191</guid>
      <dc:creator>Gregory Fruth</dc:creator>
      <dc:date>2002-04-11T19:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: malloc/free debugging in a C code!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700662#M902196</link>
      <description>hi greg,&lt;BR /&gt;thanks! do you know how to use them or where i can find more information on how to use them!&lt;BR /&gt;ravi</description>
      <pubDate>Fri, 12 Apr 2002 05:30:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700662#M902196</guid>
      <dc:creator>Ravi Abrol</dc:creator>
      <dc:date>2002-04-12T05:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: malloc/free debugging in a C code!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700663#M902200</link>
      <description>Ravi,&lt;BR /&gt;The man page for malloc itself has details on mallinfo() and memorymap().</description>
      <pubDate>Fri, 12 Apr 2002 06:01:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700663#M902200</guid>
      <dc:creator>Deepak Extross</dc:creator>
      <dc:date>2002-04-12T06:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: malloc/free debugging in a C code!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700664#M902202</link>
      <description>Ravi,&lt;BR /&gt;&lt;BR /&gt;You wont see the same problems in AIX because AIX tends to clean up memory is deallocated but not freed.&lt;BR /&gt;&lt;BR /&gt;We had a problem with an app ported from AIX to HPUX that had this problem.&lt;BR /&gt;&lt;BR /&gt;We solved 90% of our memory problems by working on the theory that everywhere there was a memory allocation there should be a corresponding free. &lt;BR /&gt;&lt;BR /&gt;Scott.&lt;BR /&gt;</description>
      <pubDate>Sun, 14 Apr 2002 21:00:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/malloc-free-debugging-in-a-c-code/m-p/2700664#M902202</guid>
      <dc:creator>Scott Van Kalken</dc:creator>
      <dc:date>2002-04-14T21:00:20Z</dc:date>
    </item>
  </channel>
</rss>

