1.0.38.4: Scrub control stack after scavenging on non-x86oid gencgc.
authorAlastair Bridgewater <lisphacker@users.sourceforge.net>
Fri, 30 Apr 2010 16:53:16 +0000 (16:53 +0000)
committerAlastair Bridgewater <lisphacker@users.sourceforge.net>
Fri, 30 Apr 2010 16:53:16 +0000 (16:53 +0000)
  * We scavenge the control stack as if it is entirely boxed data,
rewriting pointers as necessary.

  * Stack frames tend to contain uninitialized words, which is fine so
long as they are immediate data or valid pointers (they will be
counted as live data, so the scavenge may be more conservative than
necessary, but this is not an error).

  * The area beyond the current stack top is not scavenged, as it is not
live data.

  * Cheneygc scrubs the control stack (clears the area beyond the stack
top) once it (the control stack) has been scavenged.

  * Gencgc on non-x86oids (when precise stack scavenging is done) has
not been scrubbing the control stack, leading to the possibility of
having stale pointers in the active heap area.

  * Scrubbing the control stack after scavenging it reduces if not
eliminates the random GC faults observed on PPC.

  * All of this explanation probably belongs in a document describing
the hows and whys of GC on SBCL, not merely in a commit message.

NEWS
src/runtime/gencgc.c
version.lisp-expr

diff --git a/NEWS b/NEWS
index e4aeeb0..5d58181 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,9 @@ changes relative to sbcl-1.9.38:
   * bug fix: linkage-table entries on PPC now no longer overflow their
     space allocation (potentially causing crashes if they are written out
     of order).
+  * bug fix: Scrub control stack after scavenging in gencgc on non-x86oid
+    platforms, preventing the GC from seeing stale pointers on the control
+    stack in subsequent GCs (which would, and does, break invariants).
 
 changes in sbcl-1.0.38 relative to sbcl-1.0.37:
   * incompatible change: Thread names are now restricted to SIMPLE-STRINGs
index 8c61a09..9ce74d4 100644 (file)
@@ -3819,6 +3819,10 @@ scavenge_control_stack()
 
     control_stack_size = current_control_stack_pointer - control_stack;
     scavenge(control_stack, control_stack_size);
+
+    /* Scrub the unscavenged control stack space, so that we can't run
+     * into any stale pointers in a later GC. */
+    scrub_control_stack();
 }
 
 /* Scavenging Interrupt Contexts */
index 184f63e..9582f35 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".)
-"1.0.38.3"
+"1.0.38.4"