United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7011386 race in objArrayKlass::array_klass_impl
JDK-7011386 : race in objArrayKlass::array_klass_impl

Details
Type:
Bug
Submit Date:
2011-01-11
Status:
Closed
Updated Date:
2011-06-17
Project Name:
JDK
Resolved Date:
2011-04-23
Component:
hotspot
OS:
solaris_10
Sub-Component:
runtime
CPU:
x86,sparc
Priority:
P3
Resolution:
Fixed
Affected Versions:
hs20,6u4
Fixed Versions:
hs20 (b07)

Related Reports
Backport:
Backport:
Backport:
Duplicate:
Duplicate:

Sub Tasks

Description
Other threads may access _lower_dimension field before it is initialized by thread which holds the lock in objArrayKlass::array_klass_impl().
It could be the cause of 6662365.

                                    

Comments
SUGGESTED FIX

@@ -235,8 +235,8 @@ klassOop objArrayKlass::array_klass_impl
           objArrayKlassKlass::cast(Universe::objArrayKlassKlassObj())->
           allocate_objArray_klass(dimension + 1, this_oop, CHECK_NULL);
         ak = objArrayKlassHandle(THREAD, new_klass);
+        ak->set_lower_dimension(this_oop());
         this_oop->set_higher_dimension(ak());
-        ak->set_lower_dimension(this_oop());
         assert(ak->oop_is_objArray(), "incorrect initialization of objArrayKlass");
       }
     }
                                     
2011-01-11
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/d4fca0a6abde
                                     
2011-01-12
PUBLIC COMMENTS

Move _lower_dimension field initialization before _higher_dimension add storestore barrier between them and make these fields volitile.
                                     
2011-01-12



Hardware and Software, Engineered to Work Together