From e741b4525ca2d1b89de57205b5e7e8058988703a Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sun, 24 Nov 2013 00:16:38 +0400 Subject: [PATCH] Fix 'Bad signal in suspend_handler' abort on FreeBSD-9.2 * pthread_stop_world.c (GC_suspend_handler_inner): If signal number is zero then silently return (instead of ABORT) if FREEBSD (to workaround a bug in FreeBSD 9.2-RELEASE regarding signals processing, bug is observed only if THREAD_LOCAL_ALLOC defined). --- pthread_stop_world.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pthread_stop_world.c b/pthread_stop_world.c index 4208464f..e3726cd3 100644 --- a/pthread_stop_world.c +++ b/pthread_stop_world.c @@ -225,8 +225,13 @@ STATIC void GC_suspend_handler_inner(ptr_t sig_arg, IF_CANCEL(int cancel_state;) AO_t my_stop_count = AO_load(&GC_stop_count); - if ((signed_word)sig_arg != GC_sig_suspend) + if ((signed_word)sig_arg != GC_sig_suspend) { +# if defined(GC_FREEBSD_THREADS) + /* Workaround "deferred signal handling" bug in FreeBSD 9.2. */ + if (0 == sig_arg) return; +# endif ABORT("Bad signal in suspend_handler"); + } DISABLE_CANCEL(cancel_state); /* pthread_setcancelstate is not defined to be async-signal-safe. */ -- 2.40.0