home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / linux / 17165 < prev    next >
Encoding:
Internet Message Format  |  1992-11-18  |  1.8 KB

  1. Path: sparky!uunet!cs.utexas.edu!uwm.edu!ogicse!news.u.washington.edu!serval!yoda.eecs.wsu.edu!hlu
  2. From: hlu@yoda.eecs.wsu.edu (H.J. Lu)
  3. Newsgroups: comp.os.linux
  4. Subject: Re: Severe problems with "realloc" (FIX_MALLOC)!
  5. Keywords: linux realloc bug malloc
  6. Message-ID: <1992Nov19.082821.13419@serval.net.wsu.edu>
  7. Date: 19 Nov 92 08:28:21 GMT
  8. Article-I.D.: serval.1992Nov19.082821.13419
  9. References: <1992Nov19.004235.9239@arbi.Informatik.Uni-Oldenburg.DE>
  10. Sender: news@serval.net.wsu.edu (USENET News System)
  11. Organization: Washington State University
  12. Lines: 33
  13.  
  14. In article <1992Nov19.004235.9239@arbi.Informatik.Uni-Oldenburg.DE> Adrian.Wallaschek@arbi.informatik.uni-oldenburg.de (Adrian Wallaschek) writes:
  15. >
  16. >Hi fellows!
  17. >
  18. >I don't know wether I'm going to warm up forgotten discussions, but hasn't yet
  19. >anybody worked on a program that makes heavy use of realloc ?
  20. >
  21. >I had severe problems getting a regex-package (0.11) to work. I got several
  22. >IOT-Trap-cores till I remebered about the malloc(0) problem with linux.
  23. >There is a work-around for malloc and calloc in stdlib.h BUT none for realloc!
  24. >Somebody forgot something, I suppose! ;-) So to avoid unnecessary cores you
  25. >might want to include few lines to your stdlib.h (to make it easy, lets 
  26. >patch it!). Its nothing serious (just copied 5 lines) but it makes regex work!
  27. >
  28. >I have found that even some library-functions make use of realloc, I think
  29. >this might be the cause of some porting-problems.
  30. >
  31. >If this is a well known problem, please don't flame, I just wanted to help!
  32. >
  33.  
  34. [....]
  35.  
  36. As far as I understand, 
  37.  
  38. realloc (foo, 0);
  39.  
  40. should free `foo', at least under POSIX. I have put regex 0.11 in the
  41. testing release of libc 4.2. I haven't heard any bug report about
  42. that. If it is true, it is a bug in regex 0.11. You should file
  43. a bug report to the regex maintainer.
  44.  
  45.  
  46. H.J.
  47.