United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6953483 Typo related to ReduceInitialCardMarks leaves concurrent collectors vulnerable to heap corruption
6953483 : Typo related to ReduceInitialCardMarks leaves concurrent collectors vulnerable to heap corruption

Details
Type:
Bug
Submit Date:
2010-05-18
Status:
Resolved
Updated Date:
2010-09-24
Project Name:
JDK
Resolved Date:
2010-06-01
Component:
hotspot
OS:
generic
Sub-Component:
gc
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
hs18
Fixed Versions:
hs19

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Relates:
Relates:
Relates:
Relates:

Sub Tasks

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
                                     
2010-05-21
EVALUATION

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

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

The typo should be corrected as in description section.
*** (#1 of 1): [ UNSAVED ] ###@###.###
                                     
2010-05-18
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.
                                     
2010-05-18
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
                                     
2010-05-18



Hardware and Software, Engineered to Work Together