Race condition in IO manager
Race.hs
import GHC.Conc
main :: IO ()
main = do
setNumCapabilities 2
setNumCapabilities 1
setNumCapabilities 2
Command Line
$ ghc-stage2 -threaded Race.hs
[1 of 1] Compiling Main ( Race.hs, Race.o )
Linking Race ...
$ while true; do ./Race; echo -n .; done
...............................Race: GHC.Event.Manager.loop: state is already Finished
It looks like there is a race condition in GHC.Event.Thread.restartPollLoop
where a write to emState
is snuck in between releasing the executing thread and
Trac metadata
Trac field | Value |
---|---|
Version | 7.7 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | libraries/base |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |