Failure INSIDE malloc() ??

Dan Conway dconway at hpldsla.sid.hp.com
Fri Jun 21 01:37:37 AEST 1991


jog at ganzer.ecs.umass.edu (Ashwini ) writes:
> Hello Everyone, 
> 
> I'm having a problem with malloc routine. I have a large program,
> so I may run out of memory (im using free wherever possible) 
> but my program still crashes INSIDE malloc. Isnt this routine 
> supposed to return a null pointer if it runs out of allocatable
> memory? The program crashes at the following statement which is
> inside malloc.(got by running through dbx).
> 
> movb $ffffffff, (r10)
> 
> I couldnt find anything in the faq list.
> ANY help would be greatly appreciated.
> Thanks
> Ashwini			jog at ecs.umass.edu
> ----------
> 

Two possibilities come to mind: you may have freed the same pointer twice
without an intervening malloc, or you may have assigned through a pointer
after freeing it.  Either way, you might have messed up malloc's internal data
structures enough to cause it to crash.

Dan Conway
dconway at hpsid.sid.hp.com



More information about the Comp.lang.c mailing list