home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / gnu / bash / bug / 660 < prev    next >
Encoding:
Text File  |  1992-11-20  |  2.6 KB  |  76 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: problem with bash on hpux
  5. Message-ID: <9211201851.AA10342.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: Fri, 20 Nov 1992 08:51:24 GMT
  12. Approved: bug-bash@prep.ai.mit.edu
  13. Lines: 61
  14.  
  15. > Program: bash 1.12.1
  16. > OS: hpux 8.07
  17. > Machine: HP 9000/730
  18. > Compiler: HP C A.08.71
  19. > ----------------------------------------------------------------------
  20. > Problem: I do the following...
  21. >     kobra> cd ~d91ali<Here I make TAB for completion>
  22. >              <I break the competion with C-c>
  23. >     kobra> cd ~d91ali
  24. >     free: Called with already freed block argument
  25. >     Tell root@kobra to fix this someday.
  26. >     Stopping myself...ABORT instruction (core dumped)
  27.  
  28. This is the famous Sun YP library problem.  Here's a message I sent a while
  29. back explaining it.
  30.  
  31. Date: Mon, 27 Jul 1992 14:29:55 -0400
  32. From: Chet Ramey <chet@odin.INS.CWRU.Edu>
  33. To: stud7b43@x400gate.bnr.ca
  34. Subject: Re: Bug in Bash 1.12.1
  35.  
  36. > I seem to have found a bug in Bash.
  37. > How to cause the bug to appear:
  38. > 1) Start a long username-completion, e.g.
  39. >       cat ~user<TAB>
  40. >    Let it run for a while (don't know exactly how long...)
  41. >    Before it's finished, hit ^C (or whatever the break character
  42. >    is set to)
  43. > 2) As the next command, run a filename completion with a username in it, eg.
  44. >       cat ~username/.log<TAB>
  45. > Error message:  "free: Called with already freed block argument
  46.  
  47. This is a bug in the Sun YP code that everyone seems to have picked up.
  48.  
  49. Sun keeps static state in the YP library code -- a pointer into the
  50. data returned from the server.  When YP initializes itself (setpwent),
  51. it looks at this pointer and calls free on it if it's non-null.  So far,
  52. so good.
  53.  
  54. If one of the YP functions is interrupted during getpwent (the exact function
  55. is interpretwithsave()), and returns NULL, the pointer is freed without being
  56. reset to NULL, and the function returns.  The next time getpwent is called,
  57. it sees that this pointer is non-null, calls free, and the Gnu free()
  58. blows up because it's being asked to free freed memory.
  59.  
  60. The traditional Unix mallocs allow memory to be freed multiple times; that's
  61. probably why this has never been fixed.  You can probably stop it by adding
  62. an #undef USE_GNU_MALLOC to the appropriate machine description in machines.h.
  63.  
  64. Chet
  65.  
  66. --
  67. ``The use of history as therapy means the corruption of history as history.''
  68.     -- Arthur Schlesinger
  69.  
  70. Chet Ramey, Case Western Reserve University    Internet: chet@po.CWRU.Edu
  71.  
  72.