[cgl_discussion] Memory leak/corruption detection tools for Linux

Howell, David P david.p.howell at intel.com
Wed Oct 1 11:58:35 PDT 2003


I've gotten several questions from a customer trying out Linux, one
which is a 
repeat from other customer contacts and so is likely a weak spot we
should 
look to address. For this one there may be a good solution out there
already.

The issue is memory leak/corruption detection tools for
malloc/new/new[]/free...
What this customer was after is a tool that does the basic memory leak
and 
memory corruption checks that can be compiled in or run on an existing
binary
that overloads the C/C++ memory allocation APIs. Has to work in a
multi-thread
environment.

There are a lot of Linux tools to do this listed in:
     http://www.linuxjournal.com/article.php?sid=6059
and a summary of available tools at:
     http://www.cs.colorado.edu/homes/zorn/public_html/MallocDebug.html 
although it's a bit old (2/22/2001).

They tried several proprietary tools (Rational Purify, Insure++) and a
few open 
source tools (Electric Fence). All either didn't work for them or didn't
have the 
features that they want (Rational Purify can't work without recompile).

I've had experience with dmalloc that was mixed, from my work with NGPT
and 
the previous customer who requested a debug malloc capability (didn't
work well).

What I'd like to accomplish with this:
- Get recommendations from others that have successfully used a tool for
this for 
  C/C++ application development. From this hopefully I can find one that
we can 
  recommend. 
- What capabilities are in the mainstream for existing telco APPs that
they are
  expecting to be there on Linux (Solaris, others?).
- What are a complete set of requirements for tools like this? A cursory
start:
  - drop in replacement for the system's `malloc', `realloc', `calloc',
`free', ...
  - debugging facilities facilities include memory-leak tracking,
fence-post write 
    detection, file/line number reporting, and general statistics
  - Can be compiled in or can overload existing C/C++ library memory
allocation
    APIs at runtime
- Are there tools/recommended tools that we can reference from Intel
Developer 
  Services? Seems like they would have the charter for stuff like this
and we could
  reference what they recommend.

Thanks for your help with this. I'm not sure how to proceed with this,
i.e. as a new
3.0 requirement?

Regards,
Dave Howell


These are my opinions and not official opinions of Intel Corp.
 
David Howell
Intel Corporation
Telco Server Development
Server Products Division
Voice: (803) 216-2359  Fax: (803) 216-2178
 
Intel Corporation
Columbia Design Center, CBA-1
100 Center Point Circle, Suite 210
Columbia, SC 29210
 
david.p.howell at intel.com
 





More information about the cgl_discussion mailing list