home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.sys5.r3:82 comp.sys.sun.misc:5193 comp.lang.c:16311
- Path: sparky!uunet!ferkel.ucsb.edu!taco!rock!concert!rutgers!modus!gear!cadlab!martelli
- From: martelli@cadlab.sublink.org (Alex Martelli)
- Newsgroups: comp.unix.sys5.r3,comp.sys.sun.misc,comp.lang.c
- Subject: Re: compiling SAM with non-ANSI compilers
- Message-ID: <1992Nov10.072931.11878@cadlab.sublink.org>
- Date: 10 Nov 92 07:29:31 GMT
- References: <id.N1RU.TAB@ferranti.com>
- Organization: CAD.LAB S.p.A., Bologna, Italia
- Lines: 30
-
- peter@ferranti.com (peter da silva) writes:
- ...
- :OK, I've got SAM, but it's for ANSI compilers only. My System V.3.2 and
- :Sun 4.x systems only have K&R compilers. I can get it all to compile
- :pretty cleanly with "unproto", but I get a weird memory allocation
- :failure in erealloc. It looks like this:
- ...
- :Now erealloc is failing on the call to srealloc(), but the stack trace
- :says it's in free(). I can't figure out what's going on here. I'm using
- :a compiler with 32 bit ints and the standard promotion rules, so I can't
- :imagine that it's stack bashing.
- :
- :Is anyone else so demented as to try this? Has anyone had better success?
-
- My suggestion: get Conor Cahill's precious "dbmalloc" package and
- compile and link your code with that. It will help *mightily* in
- diagnosing whatever it is that it's happening to clobber your memory
- allocation! Some pointer is probably being freed twice, or overwritten
- accidentally with garbage from elsewhere, and dbmalloc will point it out
- fast. (It might be even better to use the commercial enhanced version
- of dbmalloc, "sentinel" - I haven't tried that yet, but it should have
- advantahes - however, that costs some $$$ - I think $195 for 386 Unix
- and $395 for Sun - so since you're working on a free program I assume
- you may not want to invest in that).
-
- dbmalloc has appeared in comp.sources.? in the recent past, so it should
- be VERY widely available, from any site that archives that.
- --
- Email: martelli@cadlab.sublink.org Phone: ++39 (51) 6130360
- CAD.LAB s.p.a., v. Ronzani 7/29, Casalecchio, Italia Fax: ++39 (51) 6130294
-