[9] RFR(XS): 8059735: make_not_entrant_or_zombie sees zombies

Mikael Gerdin mikael.gerdin at oracle.com
Tue Oct 7 11:35:20 UTC 2014


Hi Tobias,

On 2014-10-07 13:03, Tobias Hartmann wrote:
> Hi,
>
> please review the following patch.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8059735
> Webrev: http://cr.openjdk.java.net/~thartmann/8059735/webrev.00/
>
> Problem:
> In 'NMethodSweeper::process_nmethod' a non-entrant nmethod is processed
> and can be converted to zombie (line 549 of sweeper.cpp). To clean the
> IC stubs of that nmethod [1] we acquire the CompiledIC_lock and check
> for a safepoint. In this case, there is a safepoint request and we
> block. During the safepoint a VM_Deoptimize operation is executed (due
> to classloading) and the non-entrant nmethod is set to zombie by
> 'CodeCache::make_marked_nmethods_zombies'. After the safepoint the
> sweeper continues and tries to set the nmethod to zombie again.
>
> Solution:
> Use a MutexLockerEx with the '_no_safepoint_check_flag' to acquire the
> CompiledIC_lock.

This is an unsafe operation which will lead to a deadlock.
You _cannot_ mix taking a single lock object with and without 
_no_safepoint_check_flag!

See
https://bugs.openjdk.java.net/browse/JDK-8047290

/Mikael

>
> Testing:
> - Failing tests
> - JPRT
>
> Thanks,
> Tobias
>
> [1] https://bugs.openjdk.java.net/browse/JDK-8058737


More information about the hotspot-compiler-dev mailing list