diff options
author | Andreas Voellmy <andreas.voellmy@gmail.com> | 2015-02-02 10:50:52 -0500 |
---|---|---|
committer | Andreas Voellmy <andreas.voellmy@gmail.com> | 2015-02-02 10:50:53 -0500 |
commit | 92c93544939199f6ef758e1658149a971d4437c9 (patch) | |
tree | 0e2a82ad85071c20128b10b39b92b75dc60fd347 /rts | |
parent | 07ee96faac4996cde0ab82789eec0b70d1a35af0 (diff) | |
download | haskell-92c93544939199f6ef758e1658149a971d4437c9.tar.gz |
Fix #10017
Summary:
In the threaded RTS, a signal is delivered from the RTS to Haskell
user code by writing to file that one of the IO managers watches (via
an instance of GHC.Event.Control.Control). When the IO manager
receives the signal, it calls GHC.Conc.Signal.runHandlers to invoke
Haskell signal handler. In the move from a single IO manager to one IO
manager per capability, the behavior was (wrongly) extended so that a
signal is delivered to every event manager (see #9423), each of which
invoke Haskell signal handlers, leading to multiple invocations of
Haskell signal handlers for a single signal. This change fixes this
problem by having the RTS (in generic_handler()) notify only the
Control instance used by the TimerManager, rather than all the
per-capability IO managers.
Reviewers: austin, hvr, simonmar, Mikolaj
Reviewed By: simonmar, Mikolaj
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D641
Diffstat (limited to 'rts')
-rw-r--r-- | rts/posix/Signals.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/rts/posix/Signals.c b/rts/posix/Signals.c index 44bd0b6d9c..5fbb917cf8 100644 --- a/rts/posix/Signals.c +++ b/rts/posix/Signals.c @@ -251,18 +251,6 @@ generic_handler(int sig USED_IF_THREADS, } } - nat i; - int fd; - for (i=0; i < n_capabilities; i++) { - fd = capabilities[i]->io_manager_control_wr_fd; - if (0 <= fd) { - r = write(fd, buf, sizeof(siginfo_t)+1); - if (r == -1 && errno == EAGAIN) { - errorBelch("lost signal due to full pipe: %d\n", sig); - } - } - } - // If the IO manager hasn't told us what the FD of the write end // of its pipe is, there's not much we can do here, so just ignore // the signal.. |