#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:                    |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown    
  Difficulty:  Unknown           |    Testcase:                  
   Blockedby:                    |    Blocking:                  
     Related:                    |  
---------------------------------+------------------------------------------
Changes (by simonmar):

  * difficulty:  => Unknown
  * milestone:  7.4.1 => _|_


Comment:

 Handling out-of-memory conditions in general is quite tricky, and GHC
 doesn't make any attempt to reify memory exhaustion as an exception that
 user code can act upon (see #1791).

 The API used by `allocaBytes` and co is `allocate()` in the RTS.  It is
 specified to never fail, because it is used in parts of the system where
 failure cannot be easily handled (e.g. GMP).  It either allocates more
 memory or exits the program.

 So in summary we can't easily fix this bug, except perhaps in "obvious"
 cases such as allocating `maxBound` bytes.

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to