Assertion failed with biographical profiler and TSO heavy program
The following program ForkIoABunch.hs
:
import Control.Concurrent
main = mapM_ (\i -> forkIO $ print i) [0..10000] >> threadDelay 100000
will crash quite often (every three out of four runs or so) when run like so:
$ ghc-8.10.1 -prof -debug -rtsopts ForkIoABunch.hs && ./ForkIoABunch +RTS -hb -i0
[...]
ForkIoABunch: internal error: ASSERTION FAILED: file rts/ProfHeap.c, line 680
(GHC version 8.10.1 for x86_64_unknown_linux)
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
The failing assertion:
ASSERT( censuses[t].void_total <= censuses[t].not_used );
// should be true because: void_total is the count of
// live words that are void at this census, which *must*
// be less than the number of live words that have not
// been used yet.