there is a tool called mtrace
modify source code to
then invoke mtrace();
at the beginning of main.
and run the programm
mtrace my_program $MALLOC_TRACE
also you can use the ccmalloc library as a replacement for malloc and free
as a way to trace mem allocation
also a tool called "Electric Fence"
you can link against that will stop at any bad read/write and tell you what happened
this is the only way i know of to find illegal reads so it's kind of important.
this one will do lots of different stuff by setting SHELL variables so read the manual.
Last edited by foo_bar_foo; 07-07-2004 at 01:29 PM.