6742641: G1: NullPointerException during GCOld

Mon, 22 Sep 2008 09:56:49 -0400

author
tonyp
date
Mon, 22 Sep 2008 09:56:49 -0400
changeset 799
919e7959392a
parent 798
032ddb9432ad
child 800
5f44674206d3

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

src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp	Wed Sep 17 19:59:35 2008 +0400
     1.2 +++ b/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp	Mon Sep 22 09:56:49 2008 -0400
     1.3 @@ -208,12 +208,13 @@
     1.4                                                nd->index, _sz,
     1.5                                                true, worker_i);
     1.6      void** buf = nd->buf;
     1.7 +    size_t index = nd->index;
     1.8      delete nd;
     1.9      if (b) {
    1.10        deallocate_buffer(buf);
    1.11        return true;  // In normal case, go on to next buffer.
    1.12      } else {
    1.13 -      enqueue_complete_buffer(buf, nd->index, true);
    1.14 +      enqueue_complete_buffer(buf, index, true);
    1.15        return false;
    1.16      }
    1.17    } else {

mercurial