--- old/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp 2012-11-20 16:31:34.269430846 -0800 +++ new/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp 2012-11-20 16:31:33.222196890 -0800 @@ -302,16 +302,28 @@ for (size_t c = start_card + 1; c <= end_card; c++ /* yeah! */) { u_char entry = _array->offset_array(c); if (c - start_card > BlockOffsetArray::power_to_cards_back(1)) { - guarantee(entry > N_words, "Should be in logarithmic region"); + guarantee(entry > N_words, + err_msg("Should be in logarithmic region - " + "entry: "UINT32_FORMAT", " + "_array->offset_array(c): "UINT32_FORMAT", " + "N_words: "UINT32_FORMAT, + entry, _array->offset_array(c), N_words)); } size_t backskip = BlockOffsetArray::entry_to_cards_back(entry); size_t landing_card = c - backskip; guarantee(landing_card >= (start_card - 1), "Inv"); if (landing_card >= start_card) { - guarantee(_array->offset_array(landing_card) <= entry, "monotonicity"); + guarantee(_array->offset_array(landing_card) <= entry, + err_msg("Monotonicity - landing_card offset: "UINT32_FORMAT", " + "entry: "UINT32_FORMAT, + _array->offset_array(landing_card), entry)); } else { guarantee(landing_card == start_card - 1, "Tautology"); - guarantee(_array->offset_array(landing_card) <= N_words, "Offset value"); + // Note that N_words is the maximum offset value + guarantee(_array->offset_array(landing_card) <= N_words, + err_msg("landing card offset: "UINT32_FORMAT", " + "N_words: "UINT32_FORMAT, + _array->offset_array(landing_card), N_words)); } } } @@ -536,17 +548,26 @@ // The offset can be 0 if the block starts on a boundary. That // is checked by an assertion above. size_t start_index = _array->index_for(blk_start); - HeapWord* boundary = _array->address_for_index(start_index); + HeapWord* boundary = _array->address_for_index(start_index); assert((_array->offset_array(orig_index) == 0 && blk_start == boundary) || (_array->offset_array(orig_index) > 0 && _array->offset_array(orig_index) <= N_words), - "offset array should have been set"); + err_msg("offset array should have been set - " + "orig_index offset: "UINT32_FORMAT", " + "blk_start: "PTR_FORMAT", " + "boundary: "PTR_FORMAT, + _array->offset_array(orig_index), + blk_start, boundary)); for (size_t j = orig_index + 1; j <= end_index; j++) { assert(_array->offset_array(j) > 0 && _array->offset_array(j) <= (u_char) (N_words+BlockOffsetArray::N_powers-1), - "offset array should have been set"); + err_msg("offset array should have been set - " + UINT32_FORMAT" not > 0 OR "UINT32_FORMAT" not <= "UINT32_FORMAT, + _array->offset_array(j), + _array->offset_array(j), + (u_char) (N_words+BlockOffsetArray::N_powers-1))); } #endif }