From: William Harold Newman Date: Sun, 3 Jun 2001 14:58:59 +0000 (+0000) Subject: 0.6.12.21.flaky2.1: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=a4d2556c02207a7b04ec497155f52e4f21d2795c;p=sbcl.git 0.6.12.21.flaky2.1: 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. --- diff --git a/src/code/target-alieneval.lisp b/src/code/target-alieneval.lisp index 091841f..344fe7a 100644 --- a/src/code/target-alieneval.lisp +++ b/src/code/target-alieneval.lisp @@ -264,7 +264,7 @@ (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. diff --git a/src/compiler/generic/interr.lisp b/src/compiler/generic/interr.lisp index a76e6b3..f0fe072 100644 --- a/src/compiler/generic/interr.lisp +++ b/src/compiler/generic/interr.lisp @@ -179,6 +179,6 @@ (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.")) diff --git a/src/runtime/gencgc.c b/src/runtime/gencgc.c index acc956c..eae5f70 100644 --- a/src/runtime/gencgc.c +++ b/src/runtime/gencgc.c @@ -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() +{} diff --git a/src/runtime/runtime.h b/src/runtime/runtime.h index d041a2c..6d9d407 100644 --- a/src/runtime/runtime.h +++ b/src/runtime/runtime.h @@ -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