#7299: threadDelay broken in ghci, Mac OS X ------------------------+--------------------------------------------------- Reporter: tmcdonell | Owner: Type: bug | Status: new Priority: normal | Component: GHCi Version: 7.6.1 | Keywords: Os: MacOS X | Architecture: Unknown/Multiple Failure: GHCi crash | Testcase: Blockedby: | Blocking: Related: | ------------------------+--------------------------------------------------- `Control.Concurrent.threadDelay` fails in ghci on Mac OS X. Behaviour is correct in compiled code. To reproduce, it is enough to just execute `threadDelay` at the prompt.
Depending on the architecture, I get different behaviour: * i386: 7.6.1 and 7.7.20121003: segmentation fault (11) * x86_64: 7.6.1 and 7.7.20121003: executes without segfault, but there is no actual delay. This is on Mac OS X 10.7.5 and 10.8.2. Correct behaviour for ghci-7.6.1-x86_64 on Ubuntu 12.04. Also fine on Mac in the 7.4 series. Example output: {{{ Nightfall $ ghci GHCi, version 7.6.1: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Prelude > Foreign.Storable.sizeOf (undefined :: Int) 4 Prelude > Control.Concurrent.threadDelay (1000 * 1000) Segmentation fault: 11 }}} Sample program for the second case: {{{ import Control.Concurrent count :: Int -> IO () count n | n <= 0 = return () | otherwise = do putStrLn $ shows n "-ah-ha-ha" threadDelay (1000 * 1000) -- 1 second count (n-1) main :: IO () main = count 10 }}} -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7299> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs