Integrated: 8352116: Deadlock with GCLocker and JVMTI after JDK-8192647

Albert Mingkun Yang ayang at openjdk.org
Mon Apr 7 09:19:03 UTC 2025


On Thu, 3 Apr 2025 09:40:19 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

> Using a new lock (`JNICritical_lock`) in `GCLocker::block` to resolve a deadlock issue. The root cause of the deadlock is that holding `Heap_lock` while waiting in `GCLocker::block` is unsafe.
> 
> The new lock is held from the start of `GCLocker::block` to the end of `GCLocker::unblock`. This requires adjusting `Heap_lock`'s rank to allow acquiring `Heap_lock` while holding `JNICritical_lock`. The most important changes are in `gcVMOperations.cpp` and `mutexLocker.cpp`.
> 
> Test: tier1-8; verified failure can be observed 2/2000 and pass 8000 iterations.

This pull request has now been integrated.

Changeset: 39549f89
Author:    Albert Mingkun Yang <ayang at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/39549f89905019fa90dd20ff8b6822c1351cbaa6
Stats:     31 lines in 4 files changed: 20 ins; 7 del; 4 mod

8352116: Deadlock with GCLocker and JVMTI after JDK-8192647

Reviewed-by: kbarrett, tschatzl, eosterlund

-------------

PR: https://git.openjdk.org/jdk/pull/24407


More information about the hotspot-dev mailing list