rules_haskell
rules_haskell copied to clipboard
Profiling build fails with internal error: m32_allocator_init: Failed to map
Describe the bug
Build with -c dbg
sometimes fails with:
ghc-iserv-prof: mmap 131072 bytes at (nil): Cannot allocate memory
ghc-iserv-prof: Try specifying an address with +RTS -xm<addr> -RTS
ghc-iserv-prof: internal error: m32_allocator_init: Failed to map
(GHC version 8.10.4 for x86_64_unknown_linux)
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
ghc: ghc-iserv terminated (-6)
To Reproduce
I have no idea, this only happen on a few targets on a huge private codebase after already patching rules_haskell.
Expected behavior
It should not fail.
Environment
- OS name + version: Linux Nixos
- Bazel version: 4.1.0
- Version of the rules: current master
Additional context
Maybe related: https://gitlab.haskell.org/ghc/ghc/-/issues/19421
Note that it only happen with -fexternal-interpreter
, see #438 for a discussion why I still think using this feature for prof
build is not a good idea.
More details, it happen with GHC 8.10.4, but not with 8.10.7. I observed it too with 9.0.1 and not yet with 9.2.0-rc1.