Integrated: 8373025: test/hotspot/jtreg/gc/cslocker/TestCSLocker.java may deadlock

Axel Boldt-Christmas aboldtch at openjdk.org
Tue Dec 9 10:07:37 UTC 2025


On Wed, 3 Dec 2025 15:10:58 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:

> The main threads call to `csLocker.unlock();` may cause an allocation which may trigger a GC. This can lead to a deadlock because we have a native thread which is waiting on a signal from the main thread (which is sent in `csLocker.unlock()`) to `ReleasePrimitiveArrayCritical`. Without the call to ReleasePrimitiveArrayCritical the some GCs may be blocked.
> 
> I suggest we remove the dependency on a java thread for the `GetPrimitiveArrayCritical` / `ReleasePrimitiveArrayCritical` pair. And simply do the lock and the sleep inside native.
> 
> * Testing
>   * Stress testing test/hotspot/jtreg/gc/cslocker/TestCSLocker.java with both SerialGC and ZGC and small heap sizes
>   * GHA

This pull request has now been integrated.

Changeset: 0a557890
Author:    Axel Boldt-Christmas <aboldtch at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/0a557890a50b0dc83c70dc877027d951dcc05470
Stats:     45 lines in 3 files changed: 14 ins; 25 del; 6 mod

8373025: test/hotspot/jtreg/gc/cslocker/TestCSLocker.java may deadlock

Reviewed-by: ayang, tschatzl, stefank

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

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


More information about the hotspot-gc-dev mailing list