1.0.36.29: better Control-C signaling
authorNikodemus Siivola <nikodemus@random-state.net>
Wed, 17 Mar 2010 16:51:55 +0000 (16:51 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Wed, 17 Mar 2010 16:51:55 +0000 (16:51 +0000)
  Actually SIGNAL the SB-SYS:INTERACTIVE-INTERRUPT so that handlers
  can run.

NEWS
src/code/target-signal.lisp
tests/signals.impure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 2d32718..d6c9c73 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -49,6 +49,8 @@ changes relative to sbcl-1.0.36:
   * bug fix: leakage from ~/.asdf-install into the ASDf-INSTALL contrib build
     (lp#538974)
   * bug fix: LOOP OF-TYPE VECTOR compile-time error. (lp#540186)
+  * bug fix: SIGNAL SB-SYS:INTERACTIVE-INTERRUPT before entering the debugger
+    due to it, so that handlers can run.
 
 changes in sbcl-1.0.36 relative to sbcl-1.0.35:
   * new feature: SB-EXT:TYPEXPAND-1, SB-EXT:TYPEXPAND, and
index f23f2a4..bea8892 100644 (file)
   (flet ((interrupt-it ()
            (with-alien ((context (* os-context-t) context))
              (with-interrupts
-               (%break 'sigint 'interactive-interrupt
-                       :context context
-                       :address (sap-int (sb!vm:context-pc context)))))))
+               (let ((int (make-condition 'interactive-interrupt
+                                          :context context
+                                          :address (sap-int (sb!vm:context-pc context)))))
+                 ;; First SIGNAL, so that handlers can run.
+                 (signal int)
+                 ;; Then enter the debugger like BREAK.
+                 (%break 'sigint int))))))
     (sb!thread:interrupt-thread (sb!thread::foreground-thread)
                                 #'interrupt-it)))
 
index 675fd8a..7be8bac 100644 (file)
     (loop until returning)
     (loop repeat 1000000000)
     (assert (= saved-errno (sb-unix::get-errno)))))
+
+(with-test (:name :handle-interactive-interrupt)
+  (assert (eq :condition
+              (handler-case
+                  (sb-thread::kill-safely
+                   (sb-thread::thread-os-thread sb-thread::*current-thread*)
+                   sb-unix:sigint)
+                (sb-sys:interactive-interrupt ()
+                  :condition)))))
index 89a04bf..11a8713 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.36.28"
+"1.0.36.29"