
#7653: incorrect handling of StackOverflow exception in the event manager ---------------------------------+------------------------------------------ Reporter: nus | Owner: tibbe Type: bug | Status: patch Priority: normal | Milestone: Component: libraries/base | Version: 7.7 Keywords: | Os: Linux Architecture: Unknown/Multiple | Failure: Runtime crash Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Comment(by nus): Replying to [comment:6 kazu-yamamoto]:
First of all, I would like to discuss what is the best behavior when the stack of IO manager overflows. Perhaps the best would be not to cause stack overflows in the manager at all. At least the shutdown should be as gracious as possible.
Note that in the current parallel IO manager, timer manager and IO managers are separated. We should apply this discussion to the timer manager. Sure, the bug report and the patches were made before the new I/O manager merge. The code excerpts above that show how the thunk is accumulated are now only pertinent to 7.4 and 7.6 branches. While I'm not sure how (and if) the situation like this could be reproduced on the current HEAD, the concerns might still be applicable: 1. There're no counterparts for `c_setIOManagerControlFd` and `c_setIOManagerWakeupFd` of `newControl` in `closeControl`; 2. A situation might emerge (again, I'm not sure how, but still) when `wakeManager` would be passed an `EventManager` in the `Finished` state.
A comment to the first patch: even if we set manager's FD to -1, nobody
refers to it. What is the purpose of this patch? The RTS does, please have a look at `ioManagerWakeup` in `rts/posix/Signals.c` (and `wakeUpRts` in `rts/Schedule.c`). -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7653#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler