# HG changeset patch # User apetrusenko # Date 1268902108 25200 # Node ID 3f0549ed0c983f90aff3bf99f6cc5cfb92a55ac7 # Parent 664ae0c5e0e59e5805c382e553d9c4b077039d0e 6921710: G1: assert(new_finger >= _finger && new_finger < _region_limit,"invariant") Summary: If CM task was aborted while scanning the last object of the specified region and the size of that object is equal to bitmap's granularity then the next offset would be equal or over the region limit which is exactly what the assertion states. Reviewed-by: ysr, tonyp, jmasa diff -r 664ae0c5e0e5 -r 3f0549ed0c98 src/share/vm/gc_implementation/g1/concurrentMark.cpp --- a/src/share/vm/gc_implementation/g1/concurrentMark.cpp Thu Mar 11 11:44:43 2010 -0800 +++ b/src/share/vm/gc_implementation/g1/concurrentMark.cpp Thu Mar 18 01:48:28 2010 -0700 @@ -3704,7 +3704,14 @@ // enough to point to the next possible object header (the // bitmap knows by how much we need to move it as it knows its // granularity). - move_finger_to(_nextMarkBitMap->nextWord(_finger)); + assert(_finger < _region_limit, "invariant"); + HeapWord* new_finger = _nextMarkBitMap->nextWord(_finger); + // Check if bitmap iteration was aborted while scanning the last object + if (new_finger >= _region_limit) { + giveup_current_region(); + } else { + move_finger_to(new_finger); + } } } // At this point we have either completed iterating over the