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

Wang Huang whuang at openjdk.java.net
Wed Apr 28 06:59:04 UTC 2021


On Wed, 28 Apr 2021 00:09:41 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Wang Huang has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   fix bugs
>
> test/hotspot/jtreg/runtime/Nestmates/membership/TestNestHostErrorWithMultiThread.java line 29:
> 
>> 27:  * @summary JVM crashes when two threads encounter the same resolution error
>> 28:  *
>> 29:  * @library /test/lib
> 
> You don't use the test library

Yes. Thank you for your review.

> test/hotspot/jtreg/runtime/Nestmates/membership/TestNestHostErrorWithMultiThread.java line 33:
> 
>> 31:  * @compile HostNoNestMember.jcod
>> 32:  *
>> 33:  * @run main/othervm TestNestHostErrorWithMultiThread
> 
> No need for othervm in this test.

Sure. I will do that.

> test/hotspot/jtreg/runtime/Nestmates/membership/TestNestHostErrorWithMultiThread.java line 42:
> 
>> 40:   public static void main(String args[]) {
>> 41:     CountDownLatch latch1 = new CountDownLatch(1);
>> 42:     CountDownLatch latch2 = new CountDownLatch(2);
> 
> Please rename latch1 as run, and latch2 as started. The names should aid in understanding the logic of the synchronization.

Sure. It will make the code more clear. I will do that.Thank you.

> test/hotspot/jtreg/runtime/Nestmates/membership/TestNestHostErrorWithMultiThread.java line 45:
> 
>> 43: 
>> 44:     new Thread(new Test(latch1, latch2)).start();
>> 45:     new Thread(new Test(latch1, latch2)).start();
> 
> Nit: you only need a single Runnable instance as it is stateless. The Runnable could even be defined inline rather than as a separate named class.

It's my fault. I will adjust that. Thank you.

> test/hotspot/jtreg/runtime/Nestmates/membership/TestNestHostErrorWithMultiThread.java line 70:
> 
>> 68:         latch1.await();
>> 69:         HostNoNestMember h = new HostNoNestMember();
>> 70:         h.test();
> 
> After the call to test you should have:
> 
> throw new Error("IllegalAccessError was not thrown as expected");

Thank you. I will change that.

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

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


More information about the hotspot-runtime-dev mailing list