SIGPIPE in the GHC runtime

Donn Cave donn at avvanta.com
Wed Aug 18 16:55:11 EDT 2010


Quoth Brian Bloniarz <brian.bloniarz at gmail.com>,

> IMHO the simplest fix is the patch below: simply
> avoid SIG_IGN, instead install a handler which does nothing.
> This way, an exec() restores the handler to SIG_DFL. I've
> included a testcase too.

I don't know enough to make a case for or against this, but the
side effects are different:  whether the handler does anything
or not, it will interrupt some system calls.  Since there are
already may be a regular barrage of SIGALRMs from the GHC runtime,
maybe one more such interruption can't hurt anything ...  but
note that we recently heard from someone in Australia with a
problem on OpenSolaris where evidently these SIGALRMs were in
fact interrupting hGetContents from a pipe, and no one seemed
to have any notion why.

At any rate, the affected system calls would set EAGAIN, possibly
including the write(2) that's supposed to set EPIPE (though
I think that would be an unusual implementation.)

	Donn Cave, donn at avvanta.com


More information about the Glasgow-haskell-users mailing list