0.6.12.21.flaky2.1:
authorWilliam Harold Newman <william.newman@airmail.net>
Sun, 3 Jun 2001 14:58:59 +0000 (14:58 +0000)
committerWilliam Harold Newman <william.newman@airmail.net>
Sun, 3 Jun 2001 14:58:59 +0000 (14:58 +0000)
Since enabling QSHOW and QSHOW_SIGNALS showed that a relatively
early symptom of the memory-corruption problem is
dereferencing a 0 pointer, I added special handling
for not-our-responsibility SIGSEGV/SIGBUS in
gencgc.c.

src/code/target-alieneval.lisp
src/compiler/generic/interr.lisp
src/runtime/gencgc.c
src/runtime/runtime.h

index 091841f..344fe7a 100644 (file)
           (type symbol slot))
   (or (find slot (alien-record-type-fields type)
            :key #'alien-record-field-name)
-      (error "There is no slot named ~S in ~S" slot type)))
+      (error "There is no slot named ~S in ~S." slot type)))
 
 ;;; Extract the value from the named slot from the record ALIEN. If
 ;;; ALIEN is actually a pointer, then DEREF it first.
index a76e6b3..f0fe072 100644 (file)
   (nil-function-returned
    "A function with declared result type NIL returned.")
   (layout-invalid
-   "invalid layout (indicates obsolete instance)")
+   "Object layout is invalid. (indicates obsolete instance)")
   (object-not-complex-vector
    "Object is not a complex (non-SIMPLE-ARRAY) vector."))
index acc956c..eae5f70 100644 (file)
@@ -5868,7 +5868,7 @@ collect_garbage(unsigned last_gen)
 
        if (gencgc_verbose > 1) {
            FSHOW((stderr,
-                  "Starting GC of generation %d with raise=%d alloc=%d trig=%d GCs=%d\n",
+                  "starting GC of generation %d with raise=%d alloc=%d trig=%d GCs=%d\n",
                   gen,
                   raise,
                   generations[gen].bytes_allocated,
@@ -5876,8 +5876,8 @@ collect_garbage(unsigned last_gen)
                   generations[gen].num_gc));
        }
 
-       /* If an older generation is being filled then update its memory
-        * age. */
+       /* If an older generation is being filled, then update its
+        * memory age. */
        if (raise == 1) {
            generations[gen+1].cum_sum_bytes_allocated +=
                generations[gen+1].bytes_allocated;
@@ -6361,6 +6361,10 @@ gencgc_handle_wp_violation(void* fault_addr)
     /* Check whether the fault is within the dynamic space. */
     if (page_index == (-1)) {
 
+       /* It can be helpful to be able to put a breakpoint on this
+        * case to help diagnose low-level problems. */
+       unhandled_sigmemoryfault();
+
        /* not within the dynamic space -- not our responsibility */
        return 0;
 
@@ -6381,3 +6385,11 @@ gencgc_handle_wp_violation(void* fault_addr)
        return 1;
     }
 }
+
+/* This is to be called when we catch a SIGSEGV/SIGBUS, determine that
+ * it's not just a case of the program hitting the write barrier, and
+ * are about to let Lisp deal with it. It's basically just a
+ * convenient place to set a gdb breakpoint. */
+void
+unhandled_sigmemoryfault()
+{}
index d041a2c..6d9d407 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef _SBCL_RUNTIME_H_
 #define _SBCL_RUNTIME_H_
 
-#define QSHOW 0 /* Enable low-level debugging output? */
+#define QSHOW 1 /* Enable low-level debugging output? */
 #if QSHOW
 #define FSHOW(args) fprintf args
 #define SHOW(string) FSHOW((stderr, "/%s\n", string))
@@ -34,7 +34,7 @@
  * necessarily reentrant. But it can still be very convenient for
  * figuring out what's going on when you have a signal handling
  * problem.. */
-#define QSHOW_SIGNALS 0
+#define QSHOW_SIGNALS 1
 
 /* FIXME: There seems to be no reason that LowtagOf can't be defined
  * as a (possibly inline) function instead of a macro. It would also