From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96075323306411.tru64-unix-managers.marc@archive.invalid> From: Arrigo Triulzi Date: Fri, 01 Sep 1995 12:28:57 +0000 To: tru64-unix-managers Subject: [Q] calloc/free problems under OSF/1 3.0 X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96075323306411 Hello all, I am having some serious (and irritating) problems porting some relatively simple ANSI C code to OSF/1 3.0. I use dynamic memory allocation heavily throughout the code, i.e. lots of calloc() calls, and most of these for small amounts of memory which are then enlarged using realloc() calls. There is a lot of calloc()/free() activity throught the program. Now, on Suns (SunOS 4.1.3, gcc 2.7.0) the programs compile and run fine, even using Purify. On Linux boxes (gcc 2.7.0) same thing, runs fine even under Electric Fence (free Purify version). It even runs on SGI Irix machines. Under OSF/1 I get one of two things, either the machine says "Out of memory" after I have allocated about 100*sizeof(int) (this varies unfortunately) or I get a nice SIGSEGV in memcpy() with two perfectly valid blocks of memory. I tried the following: 1) -taso -trapuv on the complier command line. No help 2) Double checking each allocation size - they are all fine and as expected 3) Stepped through it with gdb and dbx and found calloc() returns NULL for minute memory requests (I had better add that the machine is unloaded and with plenty of free RAM/swap) I have tried isolating the problem and it all stems from a valid calloc call which returns NULL even when there seems to be plenty of RAM/swap available. This doesn't occur at the same calloc() call all the time, it depends on when it "feels like" returning a nice NULL. Has anyone seen this happen or have a solution? Thanks, Arrigo -- Arrigo Triulzi Mathematics Dept. Imperial College of Science & Technology - London - UK