Skip to content

Commit

Permalink
1.0.36.29: better Control-C signaling
Browse files Browse the repository at this point in the history
  Actually SIGNAL the SB-SYS:INTERACTIVE-INTERRUPT so that handlers
  can run.
  • Loading branch information
nikodemus committed Mar 17, 2010
1 parent 3f01b91 commit 2bb123e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions src/code/target-signal.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -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)))

Expand Down
9 changes: 9 additions & 0 deletions tests/signals.impure.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -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)))))
2 changes: 1 addition & 1 deletion version.lisp-expr
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 2bb123e

Please sign in to comment.