
#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: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: #9377 Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by AndreasVoellmy): The issue was that `forkProcess` calls `hs_exit_(rtsTrue)`, which waits for foreign calls to return. Then, the foreign calls made by IO manager threads were not woken up (the cause of this is a bit complicated so I'll explain that elsewhere). The solution in the case of forkProcess is to call `hs_exit(rtsFalse)` which is what normal exit of the Haskell RTS does anyway. However, some clients (e.g. when writing a C program that start and exit GHC RTS) may call `hs_exit()`, which calls `hs_exit_(rtsTrue)`, so the problem of waking up the foreign calls made by IO manager threads remains an issue. I now have a fix for this issue as well. So now the question is: should we close this issue, since it is specific to `forkProcess` and create a separate issue for programs calling `hs_exit()`? Or should we solve both of these issues in this issue? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9284#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler