tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: Arrigo Triulzi <a.triulzi () ic ! ac ! uk>
To: tru64-unix-managers
Subject: [Q] calloc/free problems under OSF/1 3.0
Date: Fri, 01 Sep 1995 12:28:57 +0000	[thread overview]
Message-ID: <96075323306411.tru64-unix-managers.marc@archive.invalid> (raw)

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

                 reply	other threads:[~1995-09-01 12:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox