RFR: 8264760: JVM crashes when two threads encounter the same resolution error [v3]

Wang Huang whuang at openjdk.java.net
Wed Apr 14 01:45:01 UTC 2021


On Thu, 8 Apr 2021 05:02:27 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Wang Huang has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   add throw exception
>
> test/hotspot/jtreg/runtime/Nestmates/membership/TestNestHostErrorWithMultiThread.java line 58:
> 
>> 56:   public void test() throws Throwable {
>> 57: 
>> 58:     CountDownLatch latch = new CountDownLatch(1);
> 
> The use of CDL doesn't guarantee that both threads have reached the await() before the main thread does the countDown(). If you use a CyclicBarrier instead it will trip when the second thread arrives.

I have tested `CyclicBarrier ` here and found that `CountDownLatch` could trigger this bug fast while `CyclicBarrier ` couldn't always trigger this bug.

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

PR: https://git.openjdk.java.net/jdk/pull/3392


More information about the hotspot-runtime-dev mailing list