Skip to content

+RTS -hb crash when blocking on empty TChan

Running the following code

module Main where

import Control.Concurrent
import Control.Concurrent.STM

main :: IO ()
main = do
  c <- newTChanIO
  forkIO . atomically $ readTChan c
  return ()

produces:

$ ./tmp +RTS -hb
tmp: internal error: Invalid object in processHeapClosureForDead(): 0
    (GHC version 7.6.3 for x86_64_unknown_linux)

It crashes without forkIO as well, I inserted it so that a plain run doesn't result in "thread blocked indefinitely in an STM transaction".

Trac metadata
Trac field Value
Version 7.6.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Runtime System
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information