[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: Detecting Seg faults



Francesco Orsenigo wrote:
How can i find the point where the bad dereference happens, if the program is not crashing there?
Is there a way to force a more strict memory check?
First thing to do if you suspect heap corruption is

setenv MALLOC_CHECK_ 2

- then the heap allocator does a lot more sanity checking
and you get an abort as soon as something looks strange.
This is a real lifesaver while developing.

If that doesn't help with random crashes and the code looks
sane then I'd usually reach for Valgrind...

--Adam