James G. Sack (jim) wrote:
>..
> 
> Hmmm, know anything about mtrace (man 3 mtrace -- from glibc-utils)?
> I also see mention of memwatch and dmalloc.
> These above found via
>   Memory Leak Detection in Embedded Systems
>   http://www.linuxjournal.com/article/6059
> 

OK, I tried mtrace. Unless there's some undocumented features somewhere,
it seems fairly simple minded. It reports unfreed allocations, but not
write-past end-of-allocation. I'm not sure what else it might handle. It
actually seems to hang on a double free.

Downloaded and tried memwatch. This looks more thorough, and it does
detect double frees and fencepost bugs, as advertised.

It's provided as memwatch.c and memwatch.h (which seems to need
inclusion after other headers -- at least, I had a compile error
reported from string.h if memwatch.h preceded other stuff including
string.h)

Anyway it seems worth working with, maybe even making into a library
module, although explicit linking is easy emough.

There is a test.c example program as well as decent README.

_memwatch looks good_
  http://www.linkdata.se/sourcecode.html

Regards,
..jim

-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to