Cost center heap profile restricted by biography of GHC segfaults
Steps to reproduce:
- Build GHC with profiling on 64-bit Linux
- Run T1969 with RTS options -hc -hbvoid
[ezyang@hs01 compiler]$ '/home/hs01/ezyang/ghc-compalloc/inplace/bin/ghc-stage2' -fforce-recomp -dno-debug-output -no-user-package-db -rtsopts -fno-ghci-history -c T1969.hs +RTS -V0 -tT1969.comp.stats --machine-readable -RTS -dcore-lint -static +RTS -hc -hbvoid Segmentation fault
Interestingly enough, I don't see the problem with other types of profiling, e.g. '-hd'. I tried a few simpler, nontrivial Haskell programs but I couldn't reproduce the segfault, so this is some sort of bug that only shows up in complex setting (maybe multithreading is the issue?) It reproduces quite reliably for me.
When I build the runtime system with debugging, I get a useful assert failure:
ghc-stage2: internal error: ASSERTION FAILED: file rts/ProfHeap.c, line 201 (GHC version 22.214.171.12440408 for x86_64_unknown_linux) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
This assert is complaining that the cost center (CCS_SYSTEM) never made it into the hash table for era 149.
I'll try looking for a simpler test-case later, but maybe someone can figure out what this bug is by sight.