RFR (XS) 8010723 - possible deadlock with SystemDictionary_lock

Karen Kinnear karen.kinnear at oracle.com
Fri Mar 29 07:00:56 PDT 2013


Ioi,

I take it back, this fix works fine. A bootstrap class loading is waiting on
the SystemDictionary_lock and the oldprobe->instance_load_in_progress().

So, the remove_unshareable_info and restore_unshareable_info today
are safe because they are single-threaded within the instance_load_in_progress
specifically for the boot loader.

Might want to add that to the comment. Other parallel class loaders have to be
multi-threaded through load_instance to prevent deadlocks so if we use a shared
archive for them, we would need a different solution.

thanks,
Karen

On Mar 29, 2013, at 9:06 AM, Karen Kinnear wrote:

> Ioi,
> 
> Thank you for jumping on this so quickly. I totally appreciate the detailed comments
> in the code.
> 
> The comment about the the other threads waiting on the SD_lock is not accurate -
> there is a wait above, but there is a notify in find_or_define which means that other
> threads will get through.
> 
> Does the solution depend on this?
> 
> thanks,
> Karen
> 
> On Mar 28, 2013, at 6:17 PM, Ioi Lam wrote:
> 
>> Please review:
>> 
>>      http://cr.openjdk.java.net/~iklam/8010723/sysdic_lock_001/
>> 
>> Bug: fatal error: acquiring lock Metaspace allocation lock/5 out
>>      of order with lock SystemDictionary_lock/4 -- possible deadlock
>> 
>>     http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8010723
>>     https://jbs.oracle.com/bugs/browse/JDK-8010723
>> 
>> Summary of fix:
>> 
>>     This crash is caused by the patch in JDK-8007725
>>     http://hg.openjdk.java.net/hsx/hsx25/hotspot/rev/1fc4d4768b90
>> 
>>     The code was calling Klass::remove_unshareable_info() (from within
>>     SystemDictionary::clean_up_shared_class) while
>>     holding SystemDictionary_lock. This is unnecessary and possibly
>>     unsafe.
>> 
>>     I changed the code to call Klass::remove_unshareable_info() outside
>>     of the SystemDictionary_lock. This is OK 
>>     because Klass::restore_unshareable_info() is also being called outside
>>     of SystemDictionary_lock.
>> 
>> Tests:
>> 
>>     I am running the UTE stress tests now. 
>> 
>> Thanks
>> - Ioi
>> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/attachments/20130329/f1180c14/attachment-0001.html 


More information about the hotspot-runtime-dev mailing list