JDK-7200261 : G1: Liveness counting inconsistencies during marking verification
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 7u6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2012-09-21
  • Updated: 2013-09-18
  • Resolved: 2012-09-28
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 7 JDK 8 Other
7u40Fixed 8Fixed hs24Fixed
Related Reports
Duplicate :  
Duplicate :  
Description
After merging up some of my in-progress workspaces with the latest changes in hotspot-gc, I started to see marking verification failures that are caused by inconsistencies in the liveness counting:

2.919: [GC cleanup VerifyDuringGC:(before)[Verifying threads Roots HeapRegionSets HeapRegions RemSet syms strs zone dict cldg hand C-heap code cache ]
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=/concurrentMark.cpp:1936
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/export/workspaces/7188263/src/share/vm/gc_implementation/g1/concurrentMark.cpp:1936), pid=26746, tid=14
#  guarantee(g1_par_verify_task.failures() == 0) failed: Unexpected accounting failures
#
# JRE version: Java(TM) SE Runtime Environment (7.0-b142)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.0-b02-internal-fastdebug mixed mode solaris-amd64 compressed oops)
# Core dump written. Default location: /export/GC-TEST-SUITES/gc_test_suite/gc_test_suite_3/specjvm98/core or core.26746
#
# An error report file with more information is saved as:
# /export/GC-TEST-SUITES/gc_test_suite/gc_test_suite_3/specjvm98/hs_err_pid26746.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp

Errors of this type indicate that the liveness counting data, that is collected concurrently, is out of whack when compared against some reference data generated by walking the marking bitmap.

Comments
EVALUATION Attempting to clip the range in set_card_bitmap_range to the card bitmap size incorrectly calculated the end of the range as the end of the card bitmap - resulting in incorrectly setting bits for cards not spanned by live objects. In the following: void set_card_bitmap_range(BitMap::idx_t start_idx, BitMap::idx_t last_idx) { assert(start_idx <= last_idx, "sanity"); // Set the inclusive bit range [start_idx, last_idx]. // For small ranges (up to 8 cards) use a simple loop; otherwise // use par_at_put_range. if ((last_idx - start_idx) < 8) { for (BitMap::idx_t i = start_idx; i <= last_idx; i += 1) { _card_bm->par_set_bit(i); } } else { assert(last_idx < _card_bm->size(), "sanity"); // Note BitMap::par_at_put_range() is exclusive. BitMap::idx_t max_idx = MAX2(last_idx+1, _card_bm->size()); _card_bm->par_at_put_range(start_idx, max_idx, true); } } we should be using MIN2 to calculate max_idx instead on MAX2.
21-09-2012

SUGGESTED FIX See evaluation
21-09-2012