Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!decwrl!pa.dec.com!decuac!news From: baker@wbc.enet.dec.com Newsgroups: comp.sys.amiga.programmer Subject: Problems with SAS/C 'malloc' Message-ID: <1991Mar18.152653.11750@decuac.dec.com> Date: 18 Mar 91 18:11:46 GMT Organization: Digital Equipment Corporation Lines: 26 -Message-Text-Follows- This weekend, I ran into a problem with malloc(). I'm using SAS/C 5.10 (*not* 5.10a) running under AmigaDOS 1.3.2 on a B2000 with a GVP accelerator and 5 megs of memory. The symptom: When I call malloc() with a request that's larger than the current available space (as indicated by sizmem()), it calls getmeml() to add more space to the heap, and getmemll() GURU's the system. I used CPR to trace the problem into getmeml(), but I haven't spent enough time looking at getmeml() to figure out why it's dying. The problem is *not* lack of memory; at the time of each crash, there's better than 4 megs of available space... The program I'm working on is large and rather complex, and the problem doesn't show up until a number of malloc()'s have been done succesfully. However, the bug appears reliably (i.e., every time). Unfortunately, small sample programs with excerpts from the dying code don't seem to exhibit the problem. Question: Are there any known/documented problems with the SAS/C memory allocator ? If so, does the 5.10a patch correct them ? If not, is there a clean workaround ? Thanks. Art Baker