[GHC] #5071: GHCi crashes on large alloca/allocaBytes requests

GHC cvs-ghc at haskell.org
Fri Apr 1 20:02:44 CEST 2011


#5071: GHCi crashes on large alloca/allocaBytes requests
---------------------------------+------------------------------------------
    Reporter:  guest             |        Owner:              
        Type:  bug               |       Status:  new         
    Priority:  normal            |    Milestone:              
   Component:  Compiler          |      Version:  7.0.3       
    Keywords:                    |     Testcase:              
   Blockedby:                    |   Difficulty:              
          Os:  Unknown/Multiple  |     Blocking:              
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown
---------------------------------+------------------------------------------

Comment(by guest):

 As an additional data point, I modified the sample program to call
 `mallocBytes`.  This is what I discovered:
   * `mallocBytes` throws a "resource exhausted (out of memory)" exception
   * the exception is catchable

 So it would be possible to fix the `alloca` family of functions by
 implementing them in terms of `mallocBytes`.  I think for now in the
 programs I write I'll use `malloc` and avoid `alloca`, as a workaround for
 this bug.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5071#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the Glasgow-haskell-bugs mailing list