internal error: m32_alloc_page: failed to get allocation in lower 32-bits
Summary
ghc --interactive aborts with message in the title.
Steps to reproduce
% ./inplace/bin/ghc-stage2 --interactive
GHCi, version 9.3.20211124: https://www.haskell.org/ghc/ :? for help
ghc-stage2: internal error: m32_alloc_page: failed to get allocation in lower 32-bits
(GHC version 9.3.20211124 for x86_64_unknown_openbsd)
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
gdb stack trace (not that it's particularly mysterious):
(gdb) bt
#0 thrkill () at /tmp/-:3
#1 0x00000002ed8fc80e in _libc_abort () at /usr/src/lib/libc/stdlib/abort.c:51
#2 0x000000023eb2fdd8 in rtsFatalInternalErrorFn (s=0x23eb08e06 "m32_alloc_page: failed to get allocation in lower 32-bits",
ap=0x7f7ffffc4ad0) at /home/greg/s/ghc/rts/RtsMessages.c:186
#3 0x000000023eb2ffe2 in barf (s=0x0) at /home/greg/s/ghc/rts/RtsMessages.c:48
#4 0x000000023eb6b55c in m32_alloc_page () at rts/linker/M32Alloc.c:250
#5 m32_alloc (alloc=0x2e9987e00, size=<optimized out>, alignment=<optimized out>) at rts/linker/M32Alloc.c:441
#6 0x000000023eb6b683 in ocAllocateExtras (oc=0x2e9998700, count=<optimized out>, first=0, bssSize=0)
at rts/linker/SymbolExtras.c:104
#7 0x000000023eb27a84 in loadOc (oc=0x2e9998700) at /home/greg/s/ghc/rts/Linker.c:1740
#8 0x000000023eb6ab48 in loadArchive_ (path=0x26db1a510 "/usr/local/lib/libgmp.a") at rts/linker/LoadArchive.c:535
#9 loadArchive (path=0x26db1a510 "/usr/local/lib/libgmp.a") at rts/linker/LoadArchive.c:629
#10 0x00000002bcab6059 in ?? () from /home/greg/s/ghc/libraries/ghci/dist-install/build/libHSghci-9.3-ghc9.3.20211124.so
ktrace (syscall trace) reveals this:
52253 ghc-stage2 CALL mmap(0x40000000,0x1000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,-1,0)
52253 ghc-stage2 RET mmap 1073741824/0x40000000
52253 ghc-stage2 CALL mmap(0,0x2000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,-1,0)
52253 ghc-stage2 RET mmap 9112080384/0x21f1f5000
52253 ghc-stage2 CALL kbind(0x7f7fffff48f8,24,0x2f81bae1abf0c0d7)
52253 ghc-stage2 RET kbind 0
52253 ghc-stage2 CALL mmap(0,0x3000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,-1,0)
52253 ghc-stage2 RET mmap 9471471616/0x2348b3000
52253 ghc-stage2 CALL mmap(0,0x2000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,-1,0)
52253 ghc-stage2 RET mmap 11532533760/0x2af648000
52253 ghc-stage2 CALL mmap(0x40000000,0x20000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,-1,0)
52253 ghc-stage2 RET mmap 8593272832/0x20032f000
52253 ghc-stage2 CALL kbind(0x7f7fffff4728,24,0x2f81bae1abf0c0d7)
52253 ghc-stage2 RET kbind 0
52253 ghc-stage2 CALL write(2,0x7f7fffff3f40,0x1c)
52253 ghc-stage2 GIO fd 2 wrote 28 bytes
"ghc-stage2: internal error: "
Expected behavior
Working ghci.
Environment
- GHC version used: 9.3 snapshot
Optional:
- Operating System: OpenBSD 7.0-current
- System Architecture: amd64