malloc hangs indefinitely

Doug Gwyn gwyn at smoke.BRL.MIL
Tue Jan 31 17:55:20 AEST 1989


In article <489 at marob.MASA.COM> daveh at marob.masa.com (Dave Hammond) writes:
>My guess is that malloc is in an infinite loop looking for suitable
>space in its heap.  Any suggestions on what might cause malloc to
>spin its wheels?  Have I perhaps trashed malloc's heap list?

Very likely.  If you have the source code for malloc(), you might
find that it is set up so that when compiled with -Ddebug it checks
its arena every time it's invoked.  Turning on this debugging check
will often cause an early abort of the program not far from where
the heap is being corrupted.



More information about the Comp.lang.c mailing list