[GHC] #7745: sleep interrupted in foreign call with GHC later than 7.2

#7745: sleep interrupted in foreign call with GHC later than 7.2
------------------------------+---------------------------------------------
Reporter: daniel.is.fischer | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 7.6.1 | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: None/Unknown | Blockedby:
Blocking: | Related:
------------------------------+---------------------------------------------
Noticed investigating
[http://stackoverflow.com/questions/15226806/importing-c-delay-function-
into-haskell-using-ffi this question]:
With GHC `>= 7.4`, a `sleep` in a foreign call is interrupted immediately,
GHC `< 7.4` let it sleep with the non-threaded runtime.
Test case:
{{{
#include

#7745: sleep interrupted in foreign call with GHC later than 7.2 ----------------------------------+----------------------------------------- Reporter: daniel.is.fischer | Owner: Type: bug | Status: closed Priority: normal | Component: Compiler Version: 7.6.1 | Resolution: invalid Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Blockedby: | Blocking: Related: | ----------------------------------+----------------------------------------- Changes (by ezyang): * status: new => closed * resolution: => invalid Comment: Your C code needs to handle SIGVTALRMs: {{{ nanosleep({2, 0}, {1, 995333267}) = ? ERESTART_RESTARTBLOCK (To be restarted) --- SIGVTALRM (Virtual timer expired) @ 0 (0) -- rt_sigreturn(0x1a) = -1 EINTR (Interrupted system call) }}} See also http://hackage.haskell.org/trac/ghc/wiki/Commentary/Rts/Signals -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7745#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC