6742641: G1: NullPointerException during GCOld

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
This commit is contained in:
Antonios Printezis 2008-09-22 09:56:49 -04:00
parent 1d67e1d25c
commit c03ab32ab5

View file

@ -208,12 +208,13 @@ apply_closure_to_completed_buffer_helper(int worker_i,
nd->index, _sz, nd->index, _sz,
true, worker_i); true, worker_i);
void** buf = nd->buf; void** buf = nd->buf;
size_t index = nd->index;
delete nd; delete nd;
if (b) { if (b) {
deallocate_buffer(buf); deallocate_buffer(buf);
return true; // In normal case, go on to next buffer. return true; // In normal case, go on to next buffer.
} else { } else {
enqueue_complete_buffer(buf, nd->index, true); enqueue_complete_buffer(buf, index, true);
return false; return false;
} }
} else { } else {