Skip to content

threadDelay with large values crashes the IO manager on 64-bit OS X

  System Version:	Mac OS X 10.6.8 (10K540)
  Kernel Version:	Darwin 10.8.0
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.2.1
import Control.Concurrent

main :: IO ()
main = threadDelay $ 100000001000084 + 100
$ ghc -threaded --make -fforce-recomp iocrash.hs && ./iocrash
[1 of 1] Compiling Main             ( iocrash.hs, iocrash.o )
Linking iocrash ...
iocrash: kevent: invalid argument (Invalid argument)
iocrash: ioManagerWakeup: write: Bad file descriptor
iocrash: sendWakeup: invalid argument (Bad file descriptor)
iocrash: ioManagerDie: write: Bad file descriptor

This isn't fully deterministic. Removing the "+ 100" results in the crash happening only some of the time on my system.

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