home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / aix / 8148 < prev    next >
Encoding:
Text File  |  1992-07-24  |  2.3 KB  |  46 lines

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