diff src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp @ 364:919e7959392a

6742641: G1: NullPointerException during GCOld Summary: An update buffer is not processed correctly, which causes roots into the collection set not to be scanned and, hence, for the heap to be corrupted. The cause is that an object is accessed after it has been explicitly deleted, which causes a race. Reviewed-by: jcoomes, ysr
author tonyp
date Mon, 22 Sep 2008 09:56:49 -0400
parents 37f87013dfd8
children ad8c8ca4ab0f
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp	Wed Sep 17 19:59:35 2008 +0400
+++ b/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp	Mon Sep 22 09:56:49 2008 -0400
@@ -208,12 +208,13 @@
                                               nd->index, _sz,
                                               true, worker_i);
     void** buf = nd->buf;
+    size_t index = nd->index;
     delete nd;
     if (b) {
       deallocate_buffer(buf);
       return true;  // In normal case, go on to next buffer.
     } else {
-      enqueue_complete_buffer(buf, nd->index, true);
+      enqueue_complete_buffer(buf, index, true);
       return false;
     }
   } else {