Skip to content

Internal error/segfault when profiling ghc

I've encountered ghc: internal error: LDV_recordDead: Failed to find counter for closure when profiling ghci on a large project.

Minimized reproducer:

  1. Build a profiled GHC:
./hadrian/build -j --flavour=perf+profiled_ghc+no_dynamic_ghc

I've reproduced on current master dd88a260.

  1. Unpack profiling_bug.zip.

  2. Run

cabal repl bug -w <PATH_TO_PROFILED_GHC> --repl-options='+RTS -hm -hbdrag -RTS' < /dev/null

It is also possible to get a segfault instead, by uncommenting code in A.hs.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information