#4449: GHC 7 can't do IO when demonized
----------------------------+-----------------------------------------------
Reporter: kazu-yamamoto | Owner: tibbe
Type: bug | Status: new
Priority: normal | Milestone: 7.0.2
Component: Compiler | Version: 7.1
Resolution: | Keywords: forkProcess
Testcase: | Blockedby:
Difficulty: | Os: MacOS X
Blocking: | Architecture: x86
Failure: None/Unknown |
----------------------------+-----------------------------------------------
Comment(by kazu-yamamoto):
I think I found the cause of this problem. The difference between
epoll() and kqueue() is inheritance. A forked process on Linux
inherits the FD of epoll() while one on MacOS does not inherits
the FD of kqueue().
On Linux: a parent process creates FD1 of epoll() and forks. Then
the child creates FD2 of epoll() which is different FD1. FD1
in the child process is eventually closed by GC. So, everything
goes well.
On MacOS: a parent process creates FD1 of kqueue() and
forks. But the child does not inherits FD1. And when the child
calls kqueue(), FD1 is reused. But GC will close FD1 since
old manager does not use FD1 anymore.
I guess that forkProcess() must close the FD of
epoll()/kqueue() (and two pair of the control pipes) in the child
case.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4449#comment:29>
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