0.9.8.5:
authorJuho Snellman <jsnell@iki.fi>
Thu, 29 Dec 2005 22:48:01 +0000 (22:48 +0000)
committerJuho Snellman <jsnell@iki.fi>
Thu, 29 Dec 2005 22:48:01 +0000 (22:48 +0000)
        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.

NEWS
src/code/pred.lisp
src/runtime/bsd-os.c
src/runtime/bsd-os.h
src/runtime/interrupt.c
version.lisp-expr

diff --git a/NEWS b/NEWS
index dc9abda..5857ff5 100644 (file)
--- 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
index a3d18bd..f0bf985 100644 (file)
   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)
                     (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)))
 
index 668e052..a74734b 100644 (file)
@@ -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 */
index 5dfff24..6907482 100644 (file)
@@ -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__
 
index 632267f..08bca2e 100644 (file)
@@ -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
index 59e22d6..7038088 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".)
-"0.9.8.4"
+"0.9.8.5"