On Wed, 10 Jun 2026 14:57:21 GMT, Viktor Klang <[email protected]> wrote:

>> Addresses a case where a `null`-value can sneak in to a reference chain and 
>> lead to a live lock. Introduces a regression test which stochastically 
>> reproduces the error.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Viktor Klang has updated the pull request incrementally with two additional 
> commits since the last revision:
> 
>  - Adding regression test for StampedLock
>  - Addressing the same live-lock issue found in AQS in AQLS and StampedLock

test/jdk/java/util/concurrent/tck/StampedLockTest.java line 1534:

> 1532:      * test scenario for JDK-8386085
> 1533:      */
> 1534:     public void testShortTimeoutAcquisition() throws 
> InterruptedException {

@DougLea @AlanBateman

I've added the same fix for AQLS and StampedLock to this PR.

While adding a regtest in/for Semaphore is not ideal (I'd rather put it closer 
to the implementations) I think it may be challenging to device 3 distinct 
regression tests (one for StampedLock, one for AQLS, and one for AQS) for a 
"single" bug.

So the question is whether we think it is going to be acceptable/preferable to 
have this one test which will stochastically trigger, or if we want to somehow 
device reproducers.

Let me know what you think makes sense and we'll take it from there.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31436#discussion_r3389343504

Reply via email to