RFR: 8028127: Regtest java/security/Security/SynchronizedAccess.java is incorrect [v2]

Fernando Guallini fguallini at openjdk.org
Thu Jun 6 13:13:02 UTC 2024


On Thu, 6 Jun 2024 11:25:39 GMT, Matthew Donovan <mdonovan at openjdk.org> wrote:

>> Fernando Guallini has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>> 
>>  - Merge branch 'openjdk:master' into JDK-8028127
>>  - Merge branch 'openjdk:master' into JDK-8028127
>>  - Regtest java/security/Security/SynchronizedAccess.java is  incorrect.
>
> test/jdk/java/security/Security/SynchronizedAccess.java line 79:
> 
>> 77:                     }
>> 78:                     Signature.getInstance("sigalg");
>> 79:                     // skipping first provider so there is always 1 available for getInstance
> 
> Why are you leaving one provider when the next thing to do is to add them all back again?

Since it runs multiple threads in parallel, it could happen this line is evaluated after another thread removes all providers, leading to a race condition. Leaving at least one provider assures this test won't fail intermittently. I added a new line in the comment.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19480#discussion_r1629507364



More information about the security-dev mailing list