[Haskell] crash unsafeperformio stm

Johannes Goetz johago at web.de
Tue Jul 11 23:50:16 EDT 2006


hi folks,

i'm using ghc6 (apt-get install ghc6) on debian31. as far is i 
understand, the following program shouldn't crash. can somebody tell me 
why it does? thanks a lot. johannes.

module Main(main) where

import Control.Concurrent.STM
import System.IO.Unsafe

{-# NOINLINE a #-}
a :: TMVar Int
a = unsafePerformIO $ atomically $ newTMVar 123

main = do
 atomically $ takeTMVar a >>= putTMVar a

ghc --make -fno-cse Test.hs -o test
./test
Segmentation fault



More information about the Haskell mailing list