#4493: Child from forkProcess calls select/read on parent's Handle, stealing
data
from parent
------------------------------------------+---------------------------------
Reporter: josh | Owner: simonmar
Type: bug | Status: closed
Priority: high | Milestone: 7.0.2
Component: Runtime System | Version: 6.12.1
Resolution: invalid | Keywords:
Testcase: yes | Blockedby:
Difficulty: | Os: Linux
Blocking: | Architecture: x86_64 (amd64)
Failure: Incorrect result at runtime |
------------------------------------------+---------------------------------
Comment(by simonmar):
Replying to [comment:6 simonmar]:
> In `System.Process` we always set our pipe FDs to `FD_CLOEXEC` which
would give you a nicer error message in this case - the child would fail
when trying to read the parent's pipe. I think MissingH doesn't do that
(it might be a good idea to suggest making that change to John Goerzen).
I just realised that `FD_CLOEXEC` doesn't help here (because we read
before exec'ing). What you want to do is to close all file descriptors in
the child, which you can do with the `close_fds` option when using
`System.Process`. I don't know if `MissingH` has a way to do that.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4493#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs