From: Ivan Maidanski Date: Sat, 23 Nov 2013 20:16:38 +0000 (+0400) Subject: Fix 'Bad signal in suspend_handler' abort on FreeBSD-9.2 X-Git-Tag: gc7_4_2~54 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3328747e757b4ffaa07d46dcb07f82d1201f6964;p=gc 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). --- 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. */