JDK-6992189 : G1: inconsistent base used in sparse rem set iterator
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs20
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2010-10-14
  • Updated: 2013-09-18
  • Resolved: 2011-04-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 Other
6u25Fixed 7Fixed hs20Fixed
Description
I tried to use the HeapRegionRemSetIterator class directly during testing and I was getting inconsistent results from it. In particular, the card indexes it'd return would be out-of-bounds. The reason for this is that there is an inconsistency between the remembered sets and the sparse rem set iterator with respect to what each thinks the "base" of the indexes, used to represent cards in the rem sets, is. The rem sets assume that index 0 corresponds to address 0, whereas the sparse rem set iterator assumes that index 0 corresponds to the bottom fo the heap.

The way we haven't come across this before is that we initialize the iterators that we use in the G1CollectedHeap constructor and at that point not all the heap data structures are initialized. So, it looks as if the iterator constructors pick up a value of 0 for the bottom of the heap (accidentally!) and do the right thing.

Comments
EVALUATION http://hg.openjdk.java.net/jdk7/build/hotspot/rev/9f4848ebbabd
04-12-2010

EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/9f4848ebbabd
16-10-2010

SUGGESTED FIX Just remove the _heap_bot_card_ind field and its uses from the RSHashTableIter class.
14-10-2010

EVALUATION See Description.
14-10-2010