[commit: ghc] ghc-8.0: rts/posix: Fail with HEAPOVERFLOW when out of memory during mmap (30caafe)

git at git.haskell.org git at git.haskell.org
Mon Jan 18 10:55:53 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/30caafe829ce93a2e303b506cea21395b0a725eb/ghc

>---------------------------------------------------------------

commit 30caafe829ce93a2e303b506cea21395b0a725eb
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Sun Jan 17 19:24:50 2016 +0100

    rts/posix: Fail with HEAPOVERFLOW when out of memory during mmap
    
    Test Plan: Validate
    
    Reviewers: simonmar, austin
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1787
    
    GHC Trac Issues: #11300
    
    (cherry picked from commit ae1c48c60abdfb134de7e247df851da101f0dd96)


>---------------------------------------------------------------

30caafe829ce93a2e303b506cea21395b0a725eb
 rts/posix/OSMem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rts/posix/OSMem.c b/rts/posix/OSMem.c
index 60e684f..2a3c294 100644
--- a/rts/posix/OSMem.c
+++ b/rts/posix/OSMem.c
@@ -222,7 +222,7 @@ my_mmap_or_barf (void *addr, W_ size, int operation)
             // If we request more than 3Gig, then we get EINVAL
             // instead of ENOMEM (at least on Linux).
             errorBelch("out of memory (requested %" FMT_Word " bytes)", size);
-            stg_exit(EXIT_FAILURE);
+            stg_exit(EXIT_HEAPOVERFLOW);
         } else {
             barf("getMBlock: mmap: %s", strerror(errno));
         }



More information about the ghc-commits mailing list