[GHC] #3316: Deadlock in non-threaded RTS with hPutBuf
GHC
trac at galois.com
Sat Jun 20 07:14:27 EDT 2009
#3316: Deadlock in non-threaded RTS with hPutBuf
-------------------+--------------------------------------------------------
Reporter: ganesh | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 6.8.3 | Severity: normal
Keywords: | Testcase:
Os: Linux | Architecture: x86
-------------------+--------------------------------------------------------
Using the non-threaded RTS, the attached program works fine in 6.8.2, but
deadlocks in 6.8.3 and later GHCs (including 6.10.3 and 6.11.20090618).
The program forks (runInteractiveProcess) two copies of cat, then forks
off two separate threads (forkIO) to write a large buffer to stdin of
each copy, and also lazily reads the outputs of each copy of cat, forcing
the results with an equality test.
From strace, it looks like 6.8.2 is correctly selecting on multiple FDs at
once (though just 3, rather than all 4, which I don't understand), whereas
6.8.3 doesn't and hence ends up in a deadlock when the pipe it wants to
use blocks while some other pipe is actually ready.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3316>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list