JDK-6559289 : CMS assertions wrongly assume markFromRoots() succeeds.
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 1.4.2_14
  • Priority: P5
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2007-05-18
  • Updated: 2010-11-17
  • Resolved: 2007-08-01
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.
Other Other
1.4.2_17-revFixed 1.4.2_18 b06Fixed
Description
Reviewing changes for 6409002 (part of 4615723) I noticed two assertions don't account for the return value of markFromRoots().  It would seem very unlikely, and only in a debug version, but there is a chance to incorrectly trigger an assertion.

If this ever happens, the assertion will be "Collector state should have changed".

Comments
EVALUATION sync from 1.4.2_17-rev.
22-12-2008

SUGGESTED FIX )$ sccs diffs -C concurrentMarkSweepGeneration.cpp ------- concurrentMarkSweepGeneration.cpp ------- *** /tmp/dpta4qU 2007-05-18 10:46:00.602205948 +0100 --- concurrentMarkSweepGeneration.cpp 2007-05-16 18:23:36.847287000 +0100 *************** *** 1776,1784 **** break; case Marking: // initial marking in checkpointRootsInitialWork has been completed ! markFromRoots(true); ! assert(_collectorState == Precleaning, "Collector state should " ! "have changed"); break; case Precleaning: // marking from roots in markFromRoots has been completed --- 1776,1787 ---- break; case Marking: // initial marking in checkpointRootsInitialWork has been completed ! if (markFromRoots(true)) { // we were successful ! assert(_collectorState == Precleaning, "Collector state should " ! "have changed"); ! } else { ! assert(_foregroundGCIsActive, "Internal state inconsistency"); ! } break; case Precleaning: // marking from roots in markFromRoots has been completed *************** *** 1932,1945 **** break; case Marking: // initial marking in checkpointRootsInitialWork has been completed ! if (VerifyDuringGC && ! GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) { ! Universe::verify(true); ! } ! markFromRoots(false); ! assert(_collectorState == FinalMarking, "Collector state should " "have changed"); break; case FinalMarking: if (VerifyDuringGC && GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) { --- 1935,1950 ---- break; case Marking: // initial marking in checkpointRootsInitialWork has been completed ! if (VerifyDuringGC && ! GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) { ! Universe::verify(true); ! } ! { ! bool res = markFromRoots(false); ! assert(res && _collectorState == FinalMarking, "Collector state should " "have changed"); break; + } case FinalMarking: if (VerifyDuringGC && GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
18-05-2007

EVALUATION My fault.
18-05-2007