Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!sdd.hp.com!hplabs!hpl-opus!hpcc05!hpldsla!dconway From: dconway@hpldsla.sid.hp.com (Dan Conway) Newsgroups: comp.lang.c Subject: Re: Failure INSIDE malloc() ?? Message-ID: <2170006@hpldsla.sid.hp.com> Date: 20 Jun 91 15:37:37 GMT References: <1991Jun19.131709.13260@risky.ecs.umass.edu> Organization: HP Scientific Instruments Division - Palo Alto, CA Lines: 26 jog@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@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@hpsid.sid.hp.com