1.0.25.22: SIGTERM and SIGABRT
authorGabor Melis <mega@hotpop.com>
Mon, 16 Feb 2009 21:36:46 +0000 (21:36 +0000)
committerGabor Melis <mega@hotpop.com>
Mon, 16 Feb 2009 21:36:46 +0000 (21:36 +0000)
- 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
src/runtime/interrupt.c
version.lisp-expr

index 76ffddc..a341207 100644 (file)
   (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)
index 88126e7..6824f3b 100644 (file)
@@ -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
 }
index a1997bc..4016edd 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.25.21"
+"1.0.25.22"