#2716: ghci uses an enormous amount of memory (recent 6.10 snapshots)
----------------------+-----------------------------------------------------
 Reporter:  ravi      |          Owner:                
     Type:  bug       |         Status:  new           
 Priority:  high      |      Milestone:  6.10.1        
Component:  GHCi      |        Version:  6.10.1        
 Severity:  critical  |     Resolution:                
 Keywords:            |     Difficulty:  Unknown       
 Testcase:            |   Architecture:  x86_64 (amd64)
       Os:  Linux     |  
----------------------+-----------------------------------------------------
Comment (by igloo):

 Someone else had this problem, but upgrading libedit fixed it. We think
 (but haven't verified) that this Debian patch is what fixes the problem:
 {{{
  06-fgetln.c-error.diff by Ben Burton <[EMAIL PROTECTED]>

  Routine fgetln() was behaving incorrectly on error (such as when
  EOF was reached), which in turn caused infinite memory consumption
  during read_history().

 --- a/glibc-bsd-glue/fgetln.c
 +++ a/glibc-bsd-glue/fgetln.c
 @@ -5,9 +5,10 @@
  {
     char *line=NULL;

 -   getline (&line, len, stream);
 -
 -   (*len)--; /* get rid of the trailing \0, fgetln
 -   does not have it */
 -   return line;
 +   if (getline (&line, len, stream) >= 0) {
 +       (*len)--; /* get rid of the trailing \0, fgetln
 +       does not have it */
 +       return line;
 +   } else
 +       return NULL;
  }
 }}}
 Can someone take a look to see if Gentoo's libedit looks buggy please?

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2716#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to