From 2bb123efd9f1566b2bff388b55d57698a69b69ba Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Wed, 17 Mar 2010 16:51:55 +0000 Subject: [PATCH] 1.0.36.29: better Control-C signaling Actually SIGNAL the SB-SYS:INTERACTIVE-INTERRUPT so that handlers can run. --- NEWS | 2 ++ src/code/target-signal.lisp | 10 +++++++--- tests/signals.impure.lisp | 9 +++++++++ version.lisp-expr | 2 +- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 2d32718..d6c9c73 100644 --- 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 diff --git a/src/code/target-signal.lisp b/src/code/target-signal.lisp index f23f2a4..bea8892 100644 --- a/src/code/target-signal.lisp +++ b/src/code/target-signal.lisp @@ -179,9 +179,13 @@ (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))) diff --git a/tests/signals.impure.lisp b/tests/signals.impure.lisp index 675fd8a..7be8bac 100644 --- a/tests/signals.impure.lisp +++ b/tests/signals.impure.lisp @@ -56,3 +56,12 @@ (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))))) diff --git a/version.lisp-expr b/version.lisp-expr index 89a04bf..11a8713 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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" -- 1.7.10.4