JDK-6953483 : Typo related to ReduceInitialCardMarks leaves concurrent collectors vulnerable to heap corruption
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs18
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2010-05-18
  • Updated: 2013-09-18
  • Resolved: 2010-06-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.
JDK 6 JDK 7 Other
6u21Fixed 7Fixed hs17Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
Leaves ReduceInitialCardMarks potentially troublesome for concurrent collectors.
Here's an email from ChengGuang Sun < ###@###.### > at
http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/2010-May/001819.html :-



Hi,

    I'm reading the code and have noticed a minor typo in the function
"CollectedHeap::pre_initialize()".

    I think it should be "#ifdef COMPILER2" instead of "#ifdef
COMPLER2". I haven't checked whether it has been corrected in the
latest revision.

Thanks,
Chen

Comments
EVALUATION http://hg.openjdk.java.net/hsx/hsx17/master/rev/8df74da5c44b
21-05-2010

EVALUATION http://hg.openjdk.java.net/hsx/hsx17/baseline/rev/8df74da5c44b
20-05-2010

EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/15190cbcabe9
20-05-2010

SUGGESTED FIX diff -r a00b51b2dda4 src/share/vm/gc_interface/collectedHeap.cpp --- a/src/share/vm/gc_interface/collectedHeap.cpp Mon May 17 00:47:28 2010 -0700 +++ b/src/share/vm/gc_interface/collectedHeap.cpp Tue May 18 09:35:50 2010 -0700 @@ -65,7 +65,7 @@ void CollectedHeap::pre_initialize() { void CollectedHeap::pre_initialize() { // Used for ReduceInitialCardMarks (when COMPILER2 is used); // otherwise remains unused. -#ifdef COMPLER2 +#ifdef COMPILER2 _defer_initial_card_mark = ReduceInitialCardMarks && can_elide_tlab_store_barriers() && (DeferInitialCardMark || card_mark_must_follow_store()); #else
18-05-2010

EVALUATION The typo should be corrected as in description section. *** (#1 of 1): [ UNSAVED ] ###@###.###
18-05-2010

WORK AROUND There is not a bug with the stop-world collectors. With concurrent collectors, however, the typo leaves one vulnerable to GC corruption. Fortunately, G1 has this flag switched off by default. To work around the problem when using CMS, use -XX:-ReduceInitialCardMarks.
18-05-2010