Skip to content

`ghc: internal error` when using nonmoving-gc

Summary

We use the nonmoving-gc and so I like to try it lots of places coax out issues. So i had the bright idea of what if we have ghc use it when we build our project? Long story short adding +RTS --nonmoving-gc -RTS to the build args results in an internal error on some packages.

ghc: internal error: allocGroup: free list corrupted
    (GHC version 9.2.5 for x86_64_unknown_linux)
    Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug

i thought i might be able to get more info from a ghc with the -debug runtime so i built 9.2.5 (the ghc we're using at the moment because stackage) with quick-debug+debug_info flavour

the error changes to

ghc: internal error: allocGroup: free list corrupted
    (GHC version 9.2.5 for x86_64_unknown_linux)
    Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug
ghc: internal error: ASSERTION FAILED: file rts/sm/BlockAlloc.c, line 819
    (GHC version 9.2.5 for x86_64_unknown_linux)
    Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug

not 100% on if this is two messages from the same call or not though.

I tried running in valgrind and whilst it complained about some branches using initialised data i don't think they were the cause (since i initialised them and the error is still there, if you wanna know it was complaining here https://gitlab.haskell.org/ghc/ghc/-/blob/ghc-9.2.5-release/rts/Stats.c#L510)

i'm looking for more suggestions now on how to provide useful info. i suspect getting a small repro that I can share won't be easy

Steps to reproduce

Use nonmoving-gc when building things using ghc

Expected behavior

It not to die

Environment

  • GHC version used: 9.2.5

Optional:

  • Operating System: ubuntu-20.04 via wsl2
  • System Architecture: amd64
Edited by David Hewson
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information