On Tue, 27 Jun 2023 20:54:27 GMT, Alex Menkov <amen...@openjdk.org> wrote:

>> This is follow-up JDK-8307153/JDK-8309612 (JVMTI GetThreadState on carrier 
>> should return STATE_WAITING)
>> New test tests GetThreadState for different thread states.
>> The test detected a bug in the implementation, new issue is created: 
>> JDK-8310584
>> Corresponding testcases are commented now in the test, fix for JDK-8310584 
>> will uncomment them
>
> Alex Menkov has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Added spaces in synchronized

The test is great.
I realize it is not easy to make it fully reliable though.
So, will need another pass.

test/hotspot/jtreg/serviceability/jvmti/vthread/GetThreadStateMountedTest/GetThreadStateMountedTest.java
 line 117:

> 115:                 } catch (InterruptedException ex) {
> 116:                     // expected, ignore
> 117:                 }

Shout this code account for spurious wakeups?

test/hotspot/jtreg/serviceability/jvmti/vthread/GetThreadStateMountedTest/GetThreadStateMountedTest.java
 line 241:

> 239:     private static native void waitInNative();
> 240:     // Signals waitInNative() to exit.
> 241:     private static native void endWait();

Q: Where is this native method invoked?

test/hotspot/jtreg/serviceability/jvmti/vthread/GetThreadStateMountedTest/libGetThreadStateMountedTest.cpp
 line 73:

> 71:     jint unexpected = state - actual_full;
> 72:     LOG("  ERROR: some unexpected bits are set (%x): %s\n",
> 73:        unexpected, TranslateState(unexpected));

Nit: lines 65, 73 have wrong indent.

test/hotspot/jtreg/serviceability/jvmti/vthread/GetThreadStateMountedTest/libGetThreadStateMountedTest.cpp
 line 176:

> 174:   while (!time_to_exit) {
> 175:     sleep_ms(100);
> 176:   }

Is this loop reliable in terms of thread states?

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

PR Review: https://git.openjdk.org/jdk/pull/14622#pullrequestreview-1502440716
PR Review Comment: https://git.openjdk.org/jdk/pull/14622#discussion_r1244797022
PR Review Comment: https://git.openjdk.org/jdk/pull/14622#discussion_r1244791733
PR Review Comment: https://git.openjdk.org/jdk/pull/14622#discussion_r1244809438
PR Review Comment: https://git.openjdk.org/jdk/pull/14622#discussion_r1244799190

Reply via email to