Dmalloc Logo


Search this site:

If dmalloc has saved you or your company time or money, please use your credit-card or PayPal account to donate to the cause.

Dmalloc Tutorial: 3.14 Various Other Hints That May Help
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.14 Various Other Hints That May Help

One of the problems that is often seen is that a program crashes in the libc memory code and you suspect a heap memory problem but both dmalloc and maybe valgrind don't show any problems. One of the big problems with debugging is that it is very difficult to do it without effecting how the program is run. Sometimes errors are due to subtle race conditions that are only seen when the program is running at full speed - not slowed down by debugging code.

This is especially true with threaded code which is often heavily affected when used with dmalloc and valgrind. Older versions of valgrid (maybe current) forced all threads into a single virtual system by design, which often masks reentrance bugs.

One way to work through these issues is to run with the library with very few debugging flags enabled. Many memory problems are fence-post areas so start with dmalloc checking just the fence post and error logging enabled:

dmalloc -d 0 -l dmalloc.log -p log-stats -p log-non-free -p check-fence -p check-funcs 

This enabled a small number of checks and should cause your program to run at close to full speed. The library has never been optimized for speed so some performance penalties will be felt.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated by Gray Watson on May, 16 2007 using texi2html 1.76.

This work is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.
This page should be W3C Valid XHTML and should work with most browsers.