diff options
author | Ben Gamari <ben@smart-cactus.org> | 2022-02-03 10:06:35 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-02-06 01:43:56 -0500 |
commit | fc083b480adedf26d47f880402f111680ec34183 (patch) | |
tree | 223118d16bf7cf820bd379b1ef03abdf5c7d59b0 /rts/Linker.c | |
parent | e96f50beec172f5ff95769842cb9be724363311c (diff) | |
download | haskell-fc083b480adedf26d47f880402f111680ec34183.tar.gz |
rts: Dump memory map on memory mapping failures
Fixes #20992.
Diffstat (limited to 'rts/Linker.c')
-rw-r--r-- | rts/Linker.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/rts/Linker.c b/rts/Linker.c index 6468e7818d..0b24a49979 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -33,6 +33,7 @@ #include "linker/SymbolExtras.h" #include "PathUtils.h" #include "CheckUnload.h" // createOCSectionIndices +#include "MemoryMap.h" #if !defined(mingw32_HOST_OS) #include "posix/Signals.h" @@ -1106,6 +1107,7 @@ mmap_again: MAP_PRIVATE|tryMap32Bit|fixed|flags, fd, offset); if (result == MAP_FAILED) { + reportMemoryMap(); sysErrorBelch("mmap %" FMT_Word " bytes at %p",(W_)size,map_addr); errorBelch("Try specifying an address with +RTS -xm<addr> -RTS"); return NULL; @@ -1128,6 +1130,7 @@ mmap_again: fixed = MAP_FIXED; goto mmap_again; #else + reportMemoryMap(); errorBelch("mmapForLinker: failed to mmap() memory below 2Gb; " "asked for %lu bytes at %p. " "Try specifying an address with +RTS -xm<addr> -RTS", |