-fexternal-interpreter violates W^X leading to ghc-iserv.bin: mmap ...: Not supported
Summary
Many tests relying on ghci-iserv (e.g. T13825-debugger
) seem to be broken by:
GHCi, version 9.3.20211211: https://www.haskell.org/ghc/ :? for help
ghc-iserv.bin: mmap 5267456 bytes at 0x40000000: Not supported
ghc-iserv.bin: Try specifying an address with +RTS -xm<addr> -RTS
{handle: <file descriptor: 12>}: GHCi.Message.remoteCall: end of file
Steps to reproduce
cd testsuite/tests/ghci.debugger/scripts && gmake TESTS=T13825-debugger
or simply inplace/bin/ghc-stage2 --interactive -fexternal-interpreter
Expected behavior
The tests should pass and ghci
should work.
Environment
- GHC version used: 352284de379b84331bd89b9eefa13af6f332df066
Optional:
- Operating System: OpenBSD 7.0-current
- System Architecture: amd64
More details
Looking at ktrace -tc -i
of ghc-stage2 it appears the reason for the failure is unfinished W^X fixes. Namely this mapping is not possible on OpenBSD as write and exec aren't compatible.
45230 ghc-iserv.bin CALL mmap(0x40000000,0x506000,0x7<PROT_READ|PROT_WRITE|PROT_EXEC>,0x2<MAP_PRIVATE>,12,0)
45230 ghc-iserv.bin RET mmap -1 errno 91 Not supported