SIGALRM, SIGVTALRM, and third party libraries

Donn Cave donn at
Wed Sep 8 01:17:09 EDT 2010

Quoth "Bryan O'Sullivan" <bos at>,
> That's right. There's unfortunately a ton of library code out there that was
> written by people who don't know when EINTR can bite, and the mysql client
> library happens to be the most prominent one that affects the Haskell
> world.

I wouldn't bet my life all the failures that come with the runtime timer
signals are due to code that erroneously neglects to handle EINTR.

We had someone here with a weird problem on some version of Solaris,
where cabal aborted in hGetContents, on a pipe, with error return EINTR 
(as seen in a system trace.)  No timer signals (GHCRTS=-v0), problem solved.
I don't know what the code looks like there, but I'm pretty sure cabal
has worked for others, and as far as I know no one has a clue what
happened there.

I haven't been able to track down my own problem with timer signals,
in code that runs native GUI libraries on the Haiku operating system.
The obvious thing (read message port) does retry on interrupt, but
who knows what else ... waiting on a semaphore, something like that?
Normal applications on Haiku, needless to say, are not bombarded with
signals in this manner, so ... well, GHCRTS=-v0, problem solved.

Maybe over time, Haskell programmers will clean up all those problems
in the foreign code they want to run.

	Donn Cave, donn at

More information about the Glasgow-haskell-users mailing list