Signal inconsistency between GHC and GHCi
Sven Panne
Sven.Panne at aedion.de
Wed Dec 28 07:20:10 EST 2005
After some hours of debugging Haskell code which involves the FFI, I think
I've found a bug or at least an inconsistency between code compiled with GHC
and code executed by GHCi: My program calls out to native library code which
uses usleep and/or nanosleep, and things work well when using the compiler.
But when GHCi is used, a lot of SIGALRMs are happening, which are
interrupting usleep/nanosleep (leading to EINTR). Are these signals really
intended when using GHCi? If yes, what can be done to avoid them?
One can argue that the library should check for EINTR after sleeping and
re-sleep in that case. While it is easy and portable with nanosleep, the
behaviour related to signals for usleep is explicitly unspecified, so there
is not much which can be done in that case. :-(
Any help is highly appreciated,
S.
More information about the Glasgow-haskell-bugs
mailing list