[GHC] #7500: GHC: internal error: getMBlock: mmap: Operation not permitted

GHC ghc-devs at haskell.org
Fri Aug 30 00:19:45 UTC 2013


#7500: GHC: internal error: getMBlock: mmap: Operation not permitted
----------------------------------+------------------------------------
        Reporter:  guest          |            Owner:
            Type:  bug            |           Status:  patch
        Priority:  normal         |        Milestone:  7.8.1
       Component:  Compiler       |          Version:  7.4.1
      Resolution:                 |         Keywords:
Operating System:  Linux          |     Architecture:  Unknown/Multiple
 Type of failure:  Runtime crash  |       Difficulty:  Unknown
       Test Case:                 |       Blocked By:
        Blocking:                 |  Related Tickets:
----------------------------------+------------------------------------

Comment (by Austin Seipp <aseipp@…>):

 In [changeset:acb91b920ebac992c52594adf605b2caf98ab4c0/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="acb91b920ebac992c52594adf605b2caf98ab4c0"
 Treat EPERM error from mmap as an OOM (#7500)

 Linux can give back EPERM from an mmap call when a user program attempts
 to map pages near `mmap_min_addr`, which is a kernel security measure to
 prevent people from mapping pages at address 0. We may do this when we
 hint to mmap what address to map the pages to.

 However, it's theoretically possible we're not actually out of memory -
 we could have continuously mapped pages at some other place far away
 from `mmap_min_addr` and succeeded instead. So as an added precaution,
 if mmap for a given addr gives us EPERM, we'll also attempt to map
 *again*, but without the address hint. Maybe the kernel can do the right
 thing.

 However, while testing #7500, the amount of free address space we could
 have otherwise used only turns out to be about 139MB. Which isn't really
 a lot. So, given that, we *also* otherwise treat EPERM as an out of
 memory error.

 This fixes #7500.

 Signed-off-by: Austin Seipp <aseipp at pobox.com>
 }}}

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




More information about the ghc-tickets mailing list