logo       

Signal inconsistency between GHC and GHCi: msg#00158

lang.haskell.glasgow.bugs

Subject: Signal inconsistency between GHC and GHCi

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.


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise