sb-safepoint: Fix interrupts during GC.
authorStas Boukarev <stassats@gmail.com>
Sun, 8 Sep 2013 23:19:18 +0000 (03:19 +0400)
committerStas Boukarev <stassats@gmail.com>
Sun, 8 Sep 2013 23:19:18 +0000 (03:19 +0400)
In interrupt_handle_now, move

context_sap = alloc_sap(context);
info_sap = alloc_sap(info);

after WITH_GC_AT_SAFEPOINTS_ONLY(), otherwise the allocation will
break the running GC.
Fixes lp#1133018.

NEWS
src/runtime/interrupt.c

diff --git a/NEWS b/NEWS
index b7cc955..6c1f71e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,9 @@ changes relative to sbcl-1.1.11:
     (thanks to Stephan Frank)
   * bug fix: space allocation of result bignums in SB-GMP is more accurate.
     (thanks to Stephan Frank, lp#1206191)
+  * bug fix: sb-safepoint can now reliably handle signal interruptions of
+    foreign code. (lp#1133018)
+  
   
 changes in sbcl-1.1.11 relative to sbcl-1.1.10:
   * enhancement: support building the manual under texinfo version 5.
index 882e2bb..7497d2b 100644 (file)
@@ -1084,9 +1084,12 @@ interrupt_handle_now(int signal, siginfo_t *info, os_context_t *context)
          * in PA. MG - 2005-08-29  */
 
         lispobj info_sap, context_sap;
+
+#ifdef LISP_FEATURE_SB_SAFEPOINT
+        WITH_GC_AT_SAFEPOINTS_ONLY()
+#else
         /* Leave deferrable signals blocked, the handler itself will
          * allow signals again when it sees fit. */
-#ifndef LISP_FEATURE_SB_SAFEPOINT
         unblock_gc_signals(0, 0);
 #endif
         context_sap = alloc_sap(context);
@@ -1094,9 +1097,6 @@ interrupt_handle_now(int signal, siginfo_t *info, os_context_t *context)
 
         FSHOW_SIGNAL((stderr,"/calling Lisp-level handler\n"));
 
-#ifdef LISP_FEATURE_SB_SAFEPOINT
-        WITH_GC_AT_SAFEPOINTS_ONLY()
-#endif
         funcall3(handler.lisp,
                  make_fixnum(signal),
                  info_sap,