[BusyBox] debugging with dmalloc

Erik Andersen andersen at lineo.com
Thu Mar 22 18:56:00 UTC 2001


On Thu Mar 22, 2001 at 09:15:11AM -0800, Larry Doolittle wrote:
> Glenn (and all lurkers) -
> 
> > is dmalloc supposed to create a logfile if the app segfaults ?
> 
> No.
> 
> OTOH, many segfaults really represent an ordinary libc free() call
> doing something stupid (but fast) when fed an invalid pointer.
> dmalloc will catch those, report the real error, and exit after
> writing the logfile.  That doesn't help you if you have a memory
> corruption error.  Consider Electric Fence to aid in tracking down
> those errors.

If you want to make sure that dmalloc logs things, you can
add in calls to things like
    dmalloc_log_heap_map();
    dmalloc_log_stats();
    dmalloc_log_unfreed();
into your code to be sure things are logged _before_ getting
the where you code will be segfaulting...

 -Erik

--
Erik B. Andersen   email:  andersen at lineo.com
--This message was written using 73% post-consumer electrons--





More information about the busybox mailing list