summaryrefslogtreecommitdiff
path: root/rts/Schedule.c
diff options
context:
space:
mode:
authorAlexander Vershilov <alexander.vershilov@gmail.com>2016-12-02 14:32:48 -0500
committerBen Gamari <ben@smart-cactus.org>2016-12-02 15:29:15 -0500
commit895a131f6e56847d9ebca2e9bfe19a3189e49d72 (patch)
tree0b54a54e22104ccf5b790a02448f6fb6875812a2 /rts/Schedule.c
parentf46369b8a1bf90a3bdc30f2b566c3a7e03672518 (diff)
downloadhaskell-895a131f6e56847d9ebca2e9bfe19a3189e49d72.tar.gz
Install toplevel handler inside fork.
When rts is forked it doesn't update toplevel handler, so UserInterrupt exception is sent to Thread1 that doesn't exist in forked process. We install toplevel handler when fork so signal will be delivered to the new main thread. Fixes #12903 Reviewers: simonmar, austin, erikd, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2770 GHC Trac Issues: #12903
Diffstat (limited to 'rts/Schedule.c')
-rw-r--r--rts/Schedule.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/rts/Schedule.c b/rts/Schedule.c
index 2c862af848..49687b577a 100644
--- a/rts/Schedule.c
+++ b/rts/Schedule.c
@@ -2103,7 +2103,10 @@ forkProcess(HsStablePtr *entry
ioManagerStartCap(&cap);
#endif
- rts_evalStableIO(&cap, entry, NULL); // run the action
+ // Install toplevel exception handlers, so interruption
+ // signal will be sent to the main thread.
+ // See Trac #12903
+ rts_evalStableIOMain(&cap, entry, NULL); // run the action
rts_checkSchedStatus("forkProcess",cap);
rts_unlock(cap);