From 4a3c4dc2899b799cbfa4f76dfc80123dc855f281 Mon Sep 17 00:00:00 2001 From: Gabor Melis Date: Mon, 16 Feb 2009 21:36:46 +0000 Subject: [PATCH] 1.0.25.22: SIGTERM and SIGABRT - add SIGTERM to deferrables, because it has a Lisp handler and it cannot run in some contexts (on the alt stack, gc signals blocked, ...) - move SIGABRT/SIGIOT handling to C to abort without possibly triggering Lisp errors due to the same problems as in the previous point --- src/code/target-signal.lisp | 6 ------ src/runtime/interrupt.c | 11 ++++++++++- version.lisp-expr | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/code/target-signal.lisp b/src/code/target-signal.lisp index 76ffddc..a341207 100644 --- a/src/code/target-signal.lisp +++ b/src/code/target-signal.lisp @@ -164,18 +164,12 @@ (sb!thread::terminate-session) (sb!ext:quit)) -;; Also known as SIGABRT. -(defun sigiot-handler (signal code context) - (declare (ignore signal code context)) - (sb!impl::%halt)) - (defun sb!kernel:signal-cold-init-or-reinit () #!+sb-doc "Enable all the default signals that Lisp knows how to deal with." (enable-interrupt sigint #'sigint-handler) (enable-interrupt sigterm #'sigterm-handler) (enable-interrupt sigill #'sigill-handler) - (enable-interrupt sigiot #'sigiot-handler) #!-linux (enable-interrupt sigemt #'sigemt-handler) (enable-interrupt sigfpe #'sb!vm:sigfpe-handler) diff --git a/src/runtime/interrupt.c b/src/runtime/interrupt.c index 88126e7..6824f3b 100644 --- a/src/runtime/interrupt.c +++ b/src/runtime/interrupt.c @@ -79,6 +79,7 @@ sigaddset_deferrable(sigset_t *s) { sigaddset(s, SIGHUP); sigaddset(s, SIGINT); + sigaddset(s, SIGTERM); sigaddset(s, SIGQUIT); sigaddset(s, SIGPIPE); sigaddset(s, SIGALRM); @@ -1265,6 +1266,14 @@ install_handler(int signal, void handler(int, siginfo_t*, void*)) #endif } +/* This must not go through lisp as it's allowed anytime, even when on + * the altstack. */ +void +sigabrt_handler(int signal, siginfo_t *info, void *void_context) +{ + lose("SIGABRT received.\n"); +} + void interrupt_init(void) { @@ -1287,7 +1296,7 @@ interrupt_init(void) * 3-argument form is expected.) */ (void (*)(int, siginfo_t*, void*))SIG_DFL; } - + undoably_install_low_level_interrupt_handler(SIGABRT, sigabrt_handler); SHOW("returning from interrupt_init()"); #endif } diff --git a/version.lisp-expr b/version.lisp-expr index a1997bc..4016edd 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.25.21" +"1.0.25.22" -- 1.7.10.4