# HG changeset patch # User tonyp # Date 1301937515 14400 # Node ID c84ee870e0b926ed0d220c4b0a00ea01981f15f5 # Parent abdfc822206fb22b771963a20554b06f208f9f67 7033292: G1: nightly failure: Non-dirty cards in region that should be dirty Summary: The epochs on the card cache array are initialized to 0 and our initial epoch also starts at 0. So, until the first GC, it might be possible to successfully "claim" a card which was in fact never initialized. Reviewed-by: johnc, iveresov, ysr diff -r abdfc822206f -r c84ee870e0b9 src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp --- a/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp Wed Mar 30 10:26:59 2011 -0400 +++ b/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp Mon Apr 04 13:18:35 2011 -0400 @@ -51,7 +51,11 @@ _cache_size_index(0), _expand_card_counts(false), _hot_cache(NULL), _def_use_cache(false), _use_cache(false), - _n_periods(0), + // We initialize the epochs of the array to 0. By initializing + // _n_periods to 1 and not 0 we automatically invalidate all the + // entries on the array. Otherwise we might accidentally think that + // we claimed a card that was in fact never set (see CR7033292). + _n_periods(1), _threads(NULL), _n_threads(0) {