RFR: 8217309: ZGC: Fix ZNMethodTable corruption

Per Liden per.liden at oracle.com
Tue Jan 22 09:36:33 UTC 2019


Calls to CollectedHeap::register_nmethod()/unregister_nmethod() should 
be protected by the CodeCache_lock (when called outside of safepoints). 
However, nmethod::make_unloaded() calls 
CollectedHeap::unregister_nmethod() without this lock held, which can 
corrupt the ZNMethodTable. Adding the lock is straight forward. The rest 
of the patch adjusts ZNMethodTable::unregister_nmethod() to never return 
false (which should never happen), adds the the proper asserts, etc.

Bug: https://bugs.openjdk.java.net/browse/JDK-8217309
Webrev: http://cr.openjdk.java.net/~pliden/8217309/webrev.0

Testing: Tier1-4 on all archs. Tier-1-7 on Linux/x86

(I'll update the bug with the proper fix-request label, justification, etc)

/Per



More information about the hotspot-gc-dev mailing list