Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bbn!apple!vsi1!wyse!mips!prls!philabs!linus!raybed2!cvbnet2!enosh!jeremy From: jeremy@enosh.prime.com (Jeremy Nussbaum) Newsgroups: comp.sys.sgi Subject: core dumps, malloc, notesfiles Summary: Why does mallopt(..) fix the problem Message-ID: <976@cvbnet2.UUCP> Date: 13 Mar 89 21:40:40 GMT Sender: postnews@cvbnet2.UUCP Reply-To: jeremy@jeremy.prime.com (Jeremy Nussbaum) Organization: Prime Computervision, Bedford MA Lines: 27 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,