RFR: 8372769: Test runtime/handshake/HandshakeDirectTest.java failed - JVM TI ERROR 13
Serguei Spitsyn
sspitsyn at openjdk.org
Wed Dec 3 19:05:55 UTC 2025
Please, review a simple correction of the test issue.
The test method `suspendThread()` does not throw an exception if JVMTI `SuspendThread` returns `JVMTI_ERROR_THREAD_NOT_ALIVE` or `JVMTI_ERROR_WRONG_PHASE`. So these two error codes are accepted as valid. JVMTI `SuspendThread` does not suspend the target thread in such a case, so JVMTI `ResumeThread` can return the JVMTI_ERROR_THREAD_NOT_SUSPENDED (13).
The fix is to skip call to JVMTI `ResumeThread` if JVMTI `SuspendThread` returned `JVMTI_ERROR_THREAD_NOT_ALIVE` or `JVMTI_ERROR_WRONG_PHASE`.
Testing:
This problem is hard to reproduce, but I was able to reproduce it with a JVMTI hack. The fixed test does not fail anymore.
-------------
Commit messages:
- 8372769: Test runtime/handshake/HandshakeDirectTest.java failed - JVMTI ERROR 13wq
Changes: https://git.openjdk.org/jdk/pull/28643/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28643&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8372769
Stats: 8 lines in 1 file changed: 5 ins; 0 del; 3 mod
Patch: https://git.openjdk.org/jdk/pull/28643.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/28643/head:pull/28643
PR: https://git.openjdk.org/jdk/pull/28643
More information about the hotspot-runtime-dev
mailing list