[comp.sys.sgi] core dumps, malloc, notesfiles

jeremy@enosh.prime.com (Jeremy Nussbaum) (03/14/89)

I have an sgi 4d with release 3.1 of the os.  I brought up the notesfiles
system, and had recurring core dumps on startup.  The coredumps
occured in about 10 different places, with no apparent cause.
The problem finally went away when I added the lines

mallopt(M_KEEP,0);
mallopt(M_DEBUG);

to the beginning of the main
program.  Can anyone guess/tell me why this fixed up the random
core dumps?  I realize that reusage of freed storage is a problem, but
the core dumps occurred very early on, and with the "old" version of
malloc.  Also, this code runs as is on many machines.

More info:
	- the notesfile source is 1.7.0.3, which I believe is the most
		recent.
	- the core dumps occurred at startup, in getpwnam (actually
		at the bottom of a whole bunch of calls initiated by
		the getpwnam call), in an ioctl (!) and a number of
		other places, implying that random data structures
		were being clobbered.
	- the core dumps occurred both with the default malloc, and
		with the libmalloc malloc.  Adding the above two lines
		has completely cured the problem.

Thanks,