home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.aix
- Path: sparky!uunet!snorkelwacker.mit.edu!thunder.mcrcim.mcgill.edu!sobeco!lamy
- From: lamy@sobeco.com (Jean-Francois Lamy)
- Subject: Re: SUMMARY: dbx problems
- Organization: Sobeco Ernst & Young
- Date: Fri, 24 Jul 92 14:14:27 GMT
- Message-ID: <1992Jul24.141427.28390@sobeco.com>
- References: <1992Jul23.202224.29736@ief.itg.ti.com> <BrvAFJ.6oM@news.cso.uiuc.edu>
- Sender: lamy@sobeco.com (j.lamy)
- Lines: 34
-
- block@ief.itg.ti.com (Bucky Block) writes:
- >: Funny thing, my application dies if I don't use the 3.1 malloc,
- >: does anyone know what the difference is between the two mallocs?
-
-
- marca@void.ncsa.uiuc.edu (Marc Andreessen) writes:
- >Because so many applications use memory incorrectly but work with the
- >overly liberal 3.1 malloc, IBM decided to continue to supply it with 3.2;
- >thus, the MALLOCTYPE variable.
-
- malloc()/free() bugs, overruns on malloc-ed arrays and unexpected side-effects
- on global variables get my top 3 spots as the most frequent causes for "the
- compiler is broken" whines. I cure the first two by pointing people at a
- debugging malloc replacement (it is rather amusing to see people's faces when
- code that runs on 6 platforms fails on a 7th -- and it's been a real bug all
- along -- 3.1-style mallocs were very common but the trend is towards meaner
- mallocs).
-
- You may find it useful to compile and link with C. Cahill's dbmalloc library
- recently posted to alt.sources; it is an "electric fence" malloc replacement
- that allocates extra space in the malloced blocks and uses it to store a
- "signature" and debugging data. You can then ask that all malloc and free
- calls result in a validity check of the heap, or initiate the sanity checks
- yourself. In case of corruption, it will try to pinpoint the likely cause of
- the corruption (though this is not foolproof). You can also use the library to
- spot memory leaks (as it can report the number of bytes that are in use).
-
- It compiles and links out of the box on a variety of UNIX systems, including
- AIX. Porting to a UNIX variant not listed (RISC/os) was trivial (changing
- CFLAGS). Great piece of work.
-
- Jean-Francois Lamy | lamy@sobeco.com
- Computer Networks and Systems | lamy@sobeco.ca
- Sobeco Ernst & Young, Montreal, Canada H2Z 1Y7 | uunet!sobeco!lamy
-