[GHC] #15060: outofmem testcase sometimes crashes on i386

GHC ghc-devs at haskell.org
Wed May 30 20:30:56 UTC 2018


#15060: outofmem testcase sometimes crashes on i386
-------------------------------------+-----------------------------------
        Reporter:  bgamari           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.4.3
       Component:  Runtime System    |              Version:  8.2.2
      Resolution:                    |             Keywords:  ci-breakage
Operating System:  Unknown/Multiple  |         Architecture:  x86
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D4704
       Wiki Page:                    |
-------------------------------------+-----------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"34464fed463c7be07d4664e2f4b96eaf1acfc37b/ghc"
 34464fed/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="34464fed463c7be07d4664e2f4b96eaf1acfc37b"
 rts: Don't madvise if mmap failed

 On 32-bit Linux `outofmem` did not fail with the expected out-of-memory
 error message, instead failing with,

     outofmem: internal error: getMBlock: mmap: Invalid argument

 This happened because, `my_mmap` would attempt to `madvise` even if the
 `mmap` call failed. So while `mmap` returns `ENOMEM` we nevertheless try
 to `madvise`, which clobbers `errno`, giving us the unexpected `EINVAL`
 error. Consequently we don't detect this to be an out-of-memory error.

 This should fix #15060.

 Test Plan: `make test TEST=outofmem` on i386

 Reviewers: simonmar, erikd

 Reviewed By: simonmar

 Subscribers: rwbarton, thomie, carter

 GHC Trac Issues: #15060

 Differential Revision: https://phabricator.haskell.org/D4704
 }}}

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


More information about the ghc-tickets mailing list