RFR (S) JDK-8025004: -XX:+CheckUnhandledOops asserts for JDK 8 solaris sparc fastdebug binaries

Lois Foltan lois.foltan at oracle.com
Tue Oct 8 10:34:57 PDT 2013


On 10/8/2013 1:55 AM, David Holmes wrote:
> On 3/10/2013 2:38 AM, Lois Foltan wrote:
>>
>> Please review the following fix:
>>
>> Webrev:
>>      http://cr.openjdk.java.net/~coleenp/bug_jdk8025004/
>>
>> Bug: -XX:+CheckUnhandledOops asserts for JDK 8 solaris sparc fastdebug
>> binaries
>>      https://bugs.openjdk.java.net/browse/JDK-8025004
>>
>> Summary of fix:
>>      This fix is to work around a Solaris Studio C++ 12u1 & 12u3
>> compiler bug. Basically in fastdebug builds
>>      on Solaris, CHECK_UNHANDLED_OOPs is defined causing an oop to be
>> defined as a class instead of a oopDesc *.
>>      Code within oops/instanceKlass.cpp defines several stack local
>> variables as "volatile oop init_lock". Solaris Studio C++
>>      compilers erroneously call the oop's destructor twice for the
>> volatile oop upon exit from the code segment
>
> Wow! What does that actually do in this case? I'm surprised this has 
> not been seen sooner if it impacts 12u1.
Hi David,
In the oop case, we register & deregister the oops via their 
constructors & destructors.  So assert code caught the fact that an oop 
was being deregistered without being present on the unhandled oop list.
>
>>      within the member functions. Remove the keyword "volatile" from all
>> "init_lock" stack local variables defined
>>      within oops/instanceKlass.cpp. This bug has been reported to the
>> Solaris Studio C++ compiler team.
>
> Changes looks okay to me. One has to hope that we don't some obscure 
> compiler reordering without the volatile though. :( I think it's usage 
> here was simply being "safe".
The compiler bug was exposed due to relatively recent JDK 8 development 
changes.  Coleen explained why volatile was initially used in this 
situation and why it isn't necessary at this point.  So she concurred 
that the changes were good.  Thanks for the review!
Lois
>
> David
> -----
>
>> Tests:
>>      JTREG, vm.quick.testlist on Solaris with -XX:+CheckUnhandledOops
>> specified
>>
>> Thank you, Lois
>>
>>



More information about the hotspot-runtime-dev mailing list