Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : ghc-7.6
http://hackage.haskell.org/trac/ghc/changeset/162b87dfc610efa54ce3276e9a1e90b9dcb141a7 >--------------------------------------------------------------- commit 162b87dfc610efa54ce3276e9a1e90b9dcb141a7 Author: Erik de Castro Lopo <er...@mega-nerd.com> Date: Sat Oct 6 17:23:01 2012 +1000 rts: Ignore signal before deleting timer. Fixes #7303. Was getting an ocassional hang or segfault when building GHC in a Qemu user space emulation of ARM. Turned out that the ITIMER_SIGNAL was being delivered *after* the call to timer_delete(). Setting the signal to SIG_IGN before deleting the timer solves the problem. >--------------------------------------------------------------- rts/posix/Itimer.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/rts/posix/Itimer.c b/rts/posix/Itimer.c index 8c9b1f8..80b3b56 100644 --- a/rts/posix/Itimer.c +++ b/rts/posix/Itimer.c @@ -204,6 +204,9 @@ void exitTicker (rtsBool wait STG_UNUSED) { #if defined(USE_TIMER_CREATE) + // Before deleting the timer set the signal to ignore to avoid the + // possibility of the signal being delivered after the timer is deleted. + signal(ITIMER_SIGNAL, SIG_IGN); timer_delete(timer); // ignore errors - we don't really care if it fails. #endif _______________________________________________ Cvs-ghc mailing list Cvs-ghc@haskell.org http://www.haskell.org/mailman/listinfo/cvs-ghc