RFR: 8231666: ThreadIdTable::grow() invokes invalid thread transition

Daniil Titov daniil.x.titov at oracle.com
Wed Oct 2 06:13:52 UTC 2019


Please review a change that fixes the issue. The problem here is that that the thread is added to the ThreadIdTable  (introduced in [3]) while the Threads_lock is held by 
JVM_StartThread. When new thread is added  to the thread table the table checks if its load factor is greater than required and if so it grows itself while polling for safepoints.
After changes [4]  an attempt to block the thread while holding the Threads_lock  results in assertion in Thread::check_possible_safepoint().

The fix  proposed by David Holmes ( thank you, David!)  is to skip the ThreadBlockInVM inside ThreadIdTable::grow() method if the current thread owns the Threads_lock.

Testing : Mach 5 tier1 and tier2 completed successfully, tier3 is in progress.

[1] Webrev: http://cr.openjdk.java.net/~dtitov/8231666/webrev.01/ 
[2] Bug: https://bugs.openjdk.java.net/browse/JDK-8231666 
[3] https://bugs.openjdk.java.net/browse/JDK-8185005 
[4] https://bugs.openjdk.java.net/browse/JDK-8184732 

Best regards,
Danill




More information about the serviceability-dev mailing list