home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / gnu / bash / bug / 506 < prev    next >
Encoding:
Text File  |  1992-07-27  |  1.9 KB  |  53 lines

  1. Newsgroups: gnu.bash.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!odin.ins.cwru.edu!chet
  3. From: chet@odin.ins.cwru.edu (Chet Ramey)
  4. Subject: Re: Bug in Bash 1.12.1
  5. Message-ID: <9207271829.AA14484.SM@odin.INS.CWRU.Edu>
  6. Sender: gnulists@ai.mit.edu
  7. Reply-To: chet@po.cwru.edu
  8. Organization: Gnus Not Usenet
  9. References: chet@odin.ins.cwru.edu (Chet Ramey)
  10. Distribution: gnu
  11. Date: Mon, 27 Jul 1992 10:29:55 GMT
  12. Approved: bug-bash@prep.ai.mit.edu
  13. Lines: 38
  14.  
  15. > I seem to have found a bug in Bash.
  16. > How to cause the bug to appear:
  17. > 1) Start a long username-completion, e.g.
  18. >       cat ~user<TAB>
  19. >    Let it run for a while (don't know exactly how long...)
  20. >    Before it's finished, hit ^C (or whatever the break character
  21. >    is set to)
  22. > 2) As the next command, run a filename completion with a username in it, eg.
  23. >       cat ~username/.log<TAB>
  24. > Error message:  "free: Called with already freed block argument
  25.  
  26. This is a bug in the Sun YP code that everyone seems to have picked up.
  27.  
  28. Sun keeps static state in the YP library code -- a pointer into the
  29. data returned from the server.  When YP initializes itself (setpwent),
  30. it looks at this pointer and calls free on it if it's non-null.  So far,
  31. so good.
  32.  
  33. If one of the YP functions is interrupted during getpwent (the exact function
  34. is interpretwithsave()), and returns NULL, the pointer is freed without being
  35. reset to NULL, and the function returns.  The next time getpwent is called,
  36. it sees that this pointer is non-null, calls free, and the Gnu free()
  37. blows up because it's being asked to free freed memory.
  38.  
  39. The traditional Unix mallocs allow memory to be freed multiple times; that's
  40. probably why this has never been fixed.  You can probably stop it by adding
  41. an #undef USE_GNU_MALLOC to the appropriate machine description in machines.h.
  42.  
  43. Chet
  44.  
  45. --
  46. ``The use of history as therapy means the corruption of history as history.''
  47.     -- Arthur Schlesinger
  48.  
  49. Chet Ramey, Case Western Reserve University    Internet: chet@po.CWRU.Edu
  50.  
  51.