
#9284: shutdownCapability sometimes loops indefinitely on OSX after forkProcess -------------------------------------+------------------------------------ Reporter: edsko | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by AndreasVoellmy): I haven't yet nailed it down, but here is my current guess as to what is happening when it gets stuck... The child process's IO manager thread is blocked in the foreign call on kevent indefinitely (as you describe). The intention is that `ioManagerDie()` writes to the control pipe that the kevent is subscribed to, and this write will cause the kevent call to return from its foreign call. It seems that the RTS has a file descriptor for the write end of the pipe (set by the call to `c_setIOManagerControlFd` in `GHC.Event.Control`) and so does the event manager on the HS side. I suspect that these get out of sync after the fork and exec; i.e. `ioManagerDie()` writes to some file descriptor that no longer corresponds to the write end of the pipe that kevent is waiting on. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9284#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler