STM transaction left open if there is an orElse on the path between throwSTM and catchSTM
main = join $ atomically $ do catchSTM (throwSTM ThreadKilled `orElse` return (putStrLn "wtf")) (\(e::SomeException) -> return (putStrLn "ok"))
This program crashes with a segmentation fault. Tested with GHC HEAD.
I attach the testcase and my proposed fix for the issue. I've run the fast testsuite with the proposed fix without new defects. On the other hand I'm very new to GHC, so while I'm sure in the defect and the test, the fix may be bogus.
Thanks goes to Mihály Bárász for discovering the issue.