]> granicus.if.org Git - gc/commitdiff
Fix 'Bad signal in suspend_handler' abort on FreeBSD-9.2
authorIvan Maidanski <ivmai@mail.ru>
Sat, 23 Nov 2013 20:16:38 +0000 (00:16 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Sat, 23 Nov 2013 20:16:38 +0000 (00:16 +0400)
* 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

index 4208464f8071a29fd2c0cf8d54f9245f5b443cd5..e3726cd3832a0199860ee46e80126edb5325fa5e 100644 (file)
@@ -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. */