(not) catching ^C in ghc-built application

Malcolm Wallace Malcolm.Wallace@cs.york.ac.uk
Tue, 13 Aug 2002 11:08:24 +0100


"Simon Marlow" <simonmar@microsoft.com> writes:

> It's probably quite naughty of us to install a SIGINT handler without
> checking whether there was already one installed.  The relevant code is
> in ghc/rts/Signals.c around line 359.  If you send me a patch I'll
> incorporate it.

Hmmm, ghc/rts/Signals.c only has 358 lines.  :-)  Maybe this is a
clue as to why ghc has such dodgy line numbers in its error reports...
No, hold on, `cvs update', ah that's better.

> For a quick workaround, if you install your own handler *after* calling
> startupHaskell(), you should be able to override GHC's.

The thing is, that's what I'm already doing.  At least, Haskell is
in charge of the execution, and does quite a lot of things before
calling out to an I/O action written in C, which then sets the handler.

My best guess is that the use of signal() is incompatible with the
POSIX sigaction() used by the RTS.

Regards,
    Malcolm