From c9bb20c4b0d1f232ec83569d3456b3f3edc4aa1c Mon Sep 17 00:00:00 2001 From: William Harold Newman Date: Thu, 7 Dec 2000 22:27:44 +0000 Subject: [PATCH] 0.6.9.3: As per Raymond Wiker, FreeBSD really does need CANNOT_GET_TO_SINGLE_STEP_FLAG. applied MNA patch, fixed Linux signal handling, woo hoo! --- NEWS | 8 ++++++++ src/compiler/main.lisp | 26 +++++++++++++------------- src/runtime/bsd-os.c | 1 + src/runtime/bsd-os.h | 12 ++++-------- src/runtime/interrupt.c | 34 ++++++++++++++++++++++++---------- src/runtime/linux-os.c | 1 + src/runtime/os-common.c | 1 + version.lisp-expr | 2 +- 8 files changed, 53 insertions(+), 32 deletions(-) diff --git a/NEWS b/NEWS index 6521845..2550d3b 100644 --- a/NEWS +++ b/NEWS @@ -610,6 +610,14 @@ changes in sbcl-0.6.9 relative to sbcl-0.6.8: * The C runtime system now builds with better optimization and many fewer warnings, thanks to lots of cleanups by Martin Atzmueller. +changes in sbcl-0.6.10 relative to sbcl-0.6.9: + +* A patch from Martin Atzmueller seems to have solved the SIGINT + problem, and as far as we know, signal-handling now works cleanly. + (If you find any new bugs, please report them!) +* More compiler warnings in src/runtime/ are gone, thanks to + patches from Martin Atzmueller. + planned incompatible changes in 0.7.x: * The debugger prompt sequence now goes "5]", "5[2]", "5[3]", etc. as you get deeper into recursive calls to the debugger command loop, diff --git a/src/compiler/main.lisp b/src/compiler/main.lisp index e3a1b9b..b1677cb 100644 --- a/src/compiler/main.lisp +++ b/src/compiler/main.lisp @@ -229,19 +229,19 @@ (zerop *compiler-note-count*))) (format *error-output* "~&") (pprint-logical-block (*error-output* nil :per-line-prefix "; ") - (compiler-mumble - "compilation unit ~:[finished~;aborted~]~ - ~[~:;~:*~& caught ~D fatal ERROR condition~:P~]~ - ~[~:;~:*~& caught ~D ERROR condition~:P~]~ - ~[~:;~:*~& caught ~D WARNING condition~:P~]~ - ~[~:;~:*~& caught ~D STYLE-WARNING condition~:P~]~ - ~[~:;~:*~& printed ~D note~:P~]" - abort-p - *aborted-compilation-unit-count* - *compiler-error-count* - *compiler-warning-count* - *compiler-style-warning-count* - *compiler-note-count*)))) + (compiler-mumble "compilation unit ~:[finished~;aborted~]~ + ~[~:;~:*~& caught ~D fatal ERROR condition~:P~]~ + ~[~:;~:*~& caught ~D ERROR condition~:P~]~ + ~[~:;~:*~& caught ~D WARNING condition~:P~]~ + ~[~:;~:*~& caught ~D STYLE-WARNING condition~:P~]~ + ~[~:;~:*~& printed ~D note~:P~]" + abort-p + *aborted-compilation-unit-count* + *compiler-error-count* + *compiler-warning-count* + *compiler-style-warning-count* + *compiler-note-count*))) + (format *error-output* "~&")) ;;; Evaluate BODY, then return (VALUES BODY-VALUE WARNINGS-P ;;; FAILURE-P), where BODY-VALUE is the first value of the body, and diff --git a/src/runtime/bsd-os.c b/src/runtime/bsd-os.c index dbb97a3..7227763 100644 --- a/src/runtime/bsd-os.c +++ b/src/runtime/bsd-os.c @@ -26,6 +26,7 @@ #include "arch.h" #include "globals.h" #include "interrupt.h" +#include "interr.h" #include "lispregs.h" #include "sbcl.h" diff --git a/src/runtime/bsd-os.h b/src/runtime/bsd-os.h index 1cdc422..7b094c3 100644 --- a/src/runtime/bsd-os.h +++ b/src/runtime/bsd-os.h @@ -28,14 +28,10 @@ typedef int os_vm_prot_t; * original FreeBSD port of SBCL, that's wrong, it's actually a * ucontext_t. */ typedef ucontext_t os_context_t; -/* KLUDGE: A hack inherited from CMU CL used to be conditional on - * !defined(__linux__), and has now been made conditional on - * CANNOT_GET_TO_SINGLE_STEP_FLAG: if the OS won't let us flip the - * single-step flag bit in the state stored in a signal context, then - * we need to mess around with overwriting preceding code with - * bit-flipping code. This isn't needed in Linux or OpenBSD; I haven't - * been able to test whether it's still needed in FreeBSD, so for - * conservatism it's left in. -- WHN 2000-10-24 */ +/* As the sbcl-devel message from Raymond Wiker 2000-12-01, FreeBSD + * (unlike Linux and OpenBSD) doesn't let us tweak the CPU's single + * step flag bit by messing with the flags stored in a signal context, + * so we need to implement single stepping in a more roundabout way. */ #define CANNOT_GET_TO_SINGLE_STEP_FLAG #elif defined __OpenBSD__ typedef struct sigcontext os_context_t; diff --git a/src/runtime/interrupt.c b/src/runtime/interrupt.c index 40c7e6b..aa944e4 100644 --- a/src/runtime/interrupt.c +++ b/src/runtime/interrupt.c @@ -309,9 +309,22 @@ interrupt_handle_now(int signal, siginfo_t *info, void *void_context) #endif union interrupt_handler handler; -#ifdef __linux__ - SET_FPU_CONTROL_WORD(context->__fpregs_mem.cw); -#endif + /* FIXME: The CMU CL we forked off of had this Linux-only + * operation here. Newer CMU CLs (e.g. 18c) have hairier + * Linux/i386-only logic here. SBCL seems to be more reliable + * without anything here. However, if we start supporting code + * which sets the rounding mode, then we may want to do something + * special to force the rounding mode back to some standard value + * here, so that ISRs can have a standard environment. (OTOH, if + * rounding modes are under user control, then perhaps we should + * leave this up to the user.) + * + * For now we just suppress this code completely (just like the + * parallel code in maybe_now_maybe_later). + * #ifdef __linux__ + * SET_FPU_CONTROL_WORD(context->__fpregs_mem.cw); + * #endif + */ handler = interrupt_handlers[signal]; @@ -385,14 +398,15 @@ maybe_now_maybe_later(int signal, siginfo_t *info, void *void_context) /* FIXME: See Debian cmucl 2.4.17, and mail from DTC on the CMU CL * mailing list 23 Oct 1999, for changes in FPU handling at - * interrupt time which should be ported into SBCL. + * interrupt time which should be ported into SBCL. Also see the + * analogous logic at the head of interrupt_handle_now for + * more related FIXME stuff. * - * (Is this related to the way that it seems that if we do decide - * to handle the interrupt later, we've now screwed up the FPU - * control word?) */ -#ifdef __linux__ - SET_FPU_CONTROL_WORD(context->__fpregs_mem.cw); -#endif + * For now, we just suppress this code completely. + * #ifdef __linux__ + * SET_FPU_CONTROL_WORD(context->__fpregs_mem.cw); + * #endif + */ if (SymbolValue(INTERRUPTS_ENABLED) == NIL) { diff --git a/src/runtime/linux-os.c b/src/runtime/linux-os.c index c10db75..def0b6a 100644 --- a/src/runtime/linux-os.c +++ b/src/runtime/linux-os.c @@ -27,6 +27,7 @@ #include "arch.h" #include "globals.h" #include "interrupt.h" +#include "interr.h" #include "lispregs.h" #include "sbcl.h" #include diff --git a/src/runtime/os-common.c b/src/runtime/os-common.c index 2f8a56c..1194ccc 100644 --- a/src/runtime/os-common.c +++ b/src/runtime/os-common.c @@ -13,6 +13,7 @@ #include #include "os.h" +#include "interr.h" /* Except for os_zero, these routines are only called by Lisp code. * These routines may also be replaced by os-dependent versions diff --git a/version.lisp-expr b/version.lisp-expr index ce1dfa7..95b2291 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -15,4 +15,4 @@ ;;; versions, and a string like "0.6.5.12" is used for versions which ;;; aren't released but correspond only to CVS tags or snapshots. -"0.6.9.2" +"0.6.9.3" -- 1.7.10.4