[GHC] #5188: Runtime error when allocating lots of memory

GHC ghc-devs at haskell.org
Mon Aug 26 05:20:49 UTC 2013


#5188: Runtime error when allocating lots of memory
---------------------------------+---------------------------
        Reporter:  knyblad       |            Owner:
            Type:  bug           |           Status:  new
        Priority:  low           |        Milestone:  7.6.2
       Component:  GHCi          |          Version:  6.12.1
      Resolution:                |         Keywords:
Operating System:  Linux         |     Architecture:  x86
 Type of failure:  None/Unknown  |       Difficulty:  Unknown
       Test Case:                |       Blocked By:
        Blocking:                |  Related Tickets:
---------------------------------+---------------------------

Comment (by rwbarton):

 So I investigated further with gdb, and while I no longer have the exact
 numbers, gmp was indeed asking for an allocation of more than 4095 MB,
 resulting in `osGetMBlocks(4096)` and an integer overflow when computing
 `size` resulting in `size = 0`.

 The fix should be to detect when the computation of `size` will overflow a
 `size_t`, and report an out-of-memory error if this occurs.

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




More information about the ghc-tickets mailing list