From: Juho Snellman Date: Thu, 29 Dec 2005 22:48:01 +0000 (+0000) Subject: 0.9.8.5: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=8735f137435f1a90c05df67a03e48602a79572f8;p=sbcl.git 0.9.8.5: Merge sbcl-devel "segmentation fault on recent FreeBSD-current" by NIIMI Satoshi, 2005-28-12 (with minor changes). Add comments to document the reasoning behind a couple of odd constructs in the 0.9.8.3 EQUAL changes to make them look less like CMUCL-style black magic. --- diff --git a/NEWS b/NEWS index dc9abda..5857ff5 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ ;;;; -*- coding: utf-8; -*- changes in sbcl-0.9.9 relative to sbcl-0.9.8: * optimization: faster implementation of EQUAL + * fixed segfaults on x86 FreeBSD 7-current (thanks to NIIMI Satoshi) changes in sbcl-0.9.8 relative to sbcl-0.9.7: * minor incompatible change: (SETF CLASS-NAME) and (SETF diff --git a/src/code/pred.lisp b/src/code/pred.lisp index a3d18bd..f0bf985 100644 --- a/src/code/pred.lisp +++ b/src/code/pred.lisp @@ -216,6 +216,9 @@ whose elements are EQUAL. Strings and bit-vectors are EQUAL if they are the same length and have identical components. Other arrays must be EQ to be EQUAL." + ;; Non-tail self-recursion implemented with a local auxiliary function + ;; is a lot faster than doing it the straightforward way (at least + ;; on x86oids) due to calling convention differences. -- JES, 2005-12-30 (labels ((equal-aux (x y) (cond ((%eql x y) t) @@ -231,6 +234,8 @@ (and (bit-vector-p y) (bit-vector-= x y))) (t nil)))) + ;; Use MAYBE-INLINE to get the inline expansion only once (instead + ;; of 200 times with INLINE). -- JES, 2005-12-30 (declare (maybe-inline equal-aux)) (equal-aux x y))) diff --git a/src/runtime/bsd-os.c b/src/runtime/bsd-os.c index 668e052..a74734b 100644 --- a/src/runtime/bsd-os.c +++ b/src/runtime/bsd-os.c @@ -204,6 +204,10 @@ os_install_interrupt_handlers(void) SHOW("os_install_interrupt_handlers()/bsd-os/defined(GENCGC)"); undoably_install_low_level_interrupt_handler(SIG_MEMORY_FAULT, memory_fault_handler); +#ifdef SIG_MEMORY_FAULT2 + undoably_install_low_level_interrupt_handler(SIG_MEMORY_FAULT2, + memory_fault_handler); +#endif SHOW("leaving os_install_interrupt_handlers()"); } @@ -230,6 +234,10 @@ os_install_interrupt_handlers(void) SHOW("os_install_interrupt_handlers()/bsd-os/!defined(GENCGC)"); undoably_install_low_level_interrupt_handler(SIG_MEMORY_FAULT, sigsegv_handler); +#ifdef SIG_MEMORY_FAULT2 + undoably_install_low_level_interrupt_handler(SIG_MEMORY_FAULT2, + sigsegv_handler); +#endif } #endif /* defined GENCGC */ diff --git a/src/runtime/bsd-os.h b/src/runtime/bsd-os.h index 5dfff24..6907482 100644 --- a/src/runtime/bsd-os.h +++ b/src/runtime/bsd-os.h @@ -54,7 +54,16 @@ typedef ucontext_t os_context_t; * 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 -#define SIG_MEMORY_FAULT SIGBUS +#define SIG_MEMORY_FAULT SIGSEGV +/* Sometime in late 2005 FreeBSD was changed to signal SIGSEGV instead + * of SIGBUS for memory faults, as required by POSIX. In order to + * support both new and old FreeBSD at the same time, both signals are + * hooked to the GC write barrier machinery. If you're reading this + * message in the far future where FreeBSD 6 and earlier are just + * quaint memories, feel free to delete this hack (and any code that's + * #ifdef SIG_MEMORY_FAULT2'ed). -- JES, 2005-12-30 + */ +#define SIG_MEMORY_FAULT2 SIGBUS #elif defined __OpenBSD__ diff --git a/src/runtime/interrupt.c b/src/runtime/interrupt.c index 632267f..08bca2e 100644 --- a/src/runtime/interrupt.c +++ b/src/runtime/interrupt.c @@ -1140,6 +1140,9 @@ undoably_install_low_level_interrupt_handler (int signal, (sigaction_nodefer_works ? SA_NODEFER : 0); #ifdef LISP_FEATURE_C_STACK_IS_CONTROL_STACK if((signal==SIG_MEMORY_FAULT) +#ifdef SIG_MEMORY_FAULT2 + || (signal==SIG_MEMORY_FAULT2) +#endif #ifdef SIG_INTERRUPT_THREAD || (signal==SIG_INTERRUPT_THREAD) #endif diff --git a/version.lisp-expr b/version.lisp-expr index 59e22d6..7038088 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".) -"0.9.8.4" +"0.9.8.5"