* [Q] calloc/free problems under OSF/1 3.0
@ 1995-09-01 12:28 Arrigo Triulzi
0 siblings, 0 replies; only message in thread
From: Arrigo Triulzi @ 1995-09-01 12:28 UTC (permalink / raw)
To: tru64-unix-managers
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 <arrigo@ic.ac.uk>
Mathematics Dept. Imperial College of Science & Technology - London - UK
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1995-09-01 12:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-09-01 12:28 [Q] calloc/free problems under OSF/1 3.0 Arrigo Triulzi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox