[Haskell-cafe] GHC handling of signals

Ben Franksen ben.franksen at online.de
Sat May 27 23:47:55 UTC 2023


Am 27.05.23 um 16:46 schrieb Donn Cave:
> For more on this, see
> https://mail.haskell.org/pipermail/glasgow-haskell-users/2010-August/019082.html

Am 27.05.23 um 16:52 schrieb Viktor Dukhovni:
> On Sat, May 27, 2023 at 03:53:55PM +0200, Ben Franksen wrote:
> 
>> Apparently the GHC runtime does something like
>>
>>     installHandler sigPIPE Ignore Nothing
>>
>> This is not a complaint, I find the behavior quite reasonable and much
>> more predictable than the default (why should I not be able to catch
>> EPIPE and continue?).
>>
>> The question is whether it is documented how the GHC runtime treats
>> signals and if yes where?
> 
> In the case of SIGPIPE, the relevant documentation can be found in:
> 
>      https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/ffi.html?highlight=ffi#interruptible-foreign-calls

Thanks for both of your answers. The location in the docs is a bit 
obscure, I wouldn't look for it there, but at least it is documented.

For posterity, what GHC runtime does is to install a do-nothing handler, 
rather than set it to SIG_IGN. This is so that this setting won't be 
inherited by child processes (as it would be with SIG_IGN).

Cheers
Ben
-- 
I would rather have questions that cannot be answered, than answers that
cannot be questioned.  -- Richard Feynman




More information about the Haskell-Cafe mailing list