JDK-6722112 : CMS: Incorrect encoding of overflown object arrays during concurrent precleaning
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs14,1.4.2_01,6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic,solaris,solaris_9
  • CPU: generic,x86,sparc
  • Submitted: 2008-07-03
  • Updated: 2011-12-27
  • Resolved: 2008-08-29
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 Other Other JDK 6 JDK 7 Other
1.4.2_19-rev,hs10Fixed 1.4.2_20-revFixed 1.4.2_21Fixed 5.0u19Fixed 6u12Fixed 7Fixed hs10Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
Here's the "evaluation" from 6578335 during whose investigation
this problem was first diagnosed:

What we were doing is that if we overflowed the marking stack
when trying to push a newly marked (now grey) object encountered during
precleaning, we would just dirty the card the object (now marked)
lay on, with the expectation that a later precleaning pass or the final
remark phase (which would pick up all remaining dirty cards) would deal
with the object. But of course in the case of an object _array_,
preclean/remark would just scrub the dirty pages not the entire array,
so the part of the object array that protruded off the dirtied page
on to a possibly clean page would not be scanned and if that part
contained references to white objects, those would be lost.

The fix of course is in the case of overflown object arrays,
to dirty all the pages that the newly marked overflown object array
lies on when encoding its greyness for the purposes of rescan (by a
later preclean pass or the subsequent final remark).

Comments
SUGGESTED FIX http://prt-web.sfbay.sun.com/archive/2008/08/2008-08-14-231711.ysr.cms_ovflw http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/9199f248b0ee
15-08-2008

EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/9199f248b0ee
15-08-2008

WORK AROUND No known workaround other than to turn off precleaning entirely: -XX:-CMSPrecleaningEnabled. Increasing the size of the marking stack via -XX:CMSMarkStackSize{,Max} would reduce the probability of hitting this bug.
03-07-2008

SUGGESTED FIX Dirty all of the pages that an object array straddles, not just the start of the header as was being done before.
03-07-2008

EVALUATION Note that this bug exists at least since 5uXX and possibly in 1.4.2_XX as well, and right up to current HSX 14. Appropriate subCR's will need to be filed.
03-07-2008