diff options
author | Erik de Castro Lopo <erikd@mega-nerd.com> | 2012-10-06 17:23:01 +1000 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2012-10-14 08:44:40 +1100 |
commit | 5f3c1055c2a5a59117985420909dd9148d7b2ba6 (patch) | |
tree | eeb101e0662d2f50ef6af57bef0bbd22ac30e2b4 /rts | |
parent | 22df9533d0a0a51268135ce46c0ca9ffcbbaa82a (diff) | |
download | haskell-5f3c1055c2a5a59117985420909dd9148d7b2ba6.tar.gz |
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.
Diffstat (limited to 'rts')
-rw-r--r-- | 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 8c9b1f8847..80b3b56945 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 |