threadDelay broken in ghci, Mac OS X
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
Trac metadata
Trac field | Value |
---|---|
Version | 7.6.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | GHCi |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |