JDK-8307968 : serviceability/jvmti/vthread/StopThreadTest/StopThreadTest.java timed out
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: 21
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86_64
  • Submitted: 2023-05-12
  • Updated: 2023-05-22
  • Resolved: 2023-05-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 21
21 b23Fixed
Related Reports
Relates :  
Description
The following new test timed out in the JDK21 CI:

serviceability/jvmti/vthread/StopThreadTest/StopThreadTest.java

Here's a snippet from the log file:

#section:main
----------messages:(8/343)----------
command: main -agentlib:StopThreadTest StopThreadTest
reason: User specified action: run main/othervm/native -agentlib:StopThreadTest StopThreadTest 
started: Thu May 11 23:54:49 GMT 2023
Mode: othervm [/othervm specified]
Timeout information:
--- Timeout information end.
finished: Fri May 12 00:03:53 GMT 2023
elapsed time (seconds): 543.32
----------configuration:(0/0)----------
----------System.out:(15/446)----------
Agent init
Main: prepareAgent started
Main: prepareAgent finished

Main #A: method A() must be blocked on entering a synchronized statement
TestTask.run: started

Main #A.1: unsuspended
Main: stopThread: StopThread returned code: JVMTI_ERROR_THREAD_NOT_SUSPENDED (13)
Main #A.1: got expected THREAD_NOT_SUSPENDED

Main #A.2: suspended
Main: suspendThread
Main: stopThread: StopThread returned code: JVMTI_ERROR_NONE (0)
Timeout refired 480 times
----------System.err:(3/186)----------
java version "21-ea" 2023-09-19 LTS
Java(TM) SE Runtime Environment (fastdebug build 21-ea+23-LTS-1910)
Java HotSpot(TM) 64-Bit Server VM (fastdebug build 21-ea+23-LTS-1910, mixed mode)
----------rerun:(36/6757)*----------

<snip>

result: Error. Program `/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk-21+23-1910/macosx-x64-debug.jdk/jdk-21/fastdebug/bin/java' timed out (timeout set to 480000ms, elapsed time including timeout handling was 543310ms).

This test was recently added by:

JDK-8306034 add support of virtual threads to JVMTI StopThread

Comments
Changeset: c2ef3024 Author: Serguei Spitsyn <sspitsyn@openjdk.org> Date: 2023-05-16 07:20:01 +0000 URL: https://git.openjdk.org/jdk/commit/c2ef3024689d60c79320ab3ef9a2fdeccb4cde72
16-05-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/13969 Date: 2023-05-13 07:28:38 +0000
13-05-2023

Here's a log file snippet from the jdk-21+23-1920-tier1 sighting: serviceability/jvmti/vthread/StopThreadTest/StopThreadTest.java#default #section:main ----------messages:(6/292)---------- command: main -agentlib:StopThreadTest StopThreadTest reason: User specified action: run main/othervm/native -agentlib:StopThreadTest StopThreadTest started: Fri May 12 07:04:48 GMT 2023 Mode: othervm [/othervm specified] finished: Fri May 12 07:04:49 GMT 2023 elapsed time (seconds): 0.964 ----------configuration:(0/0)---------- ----------System.out:(16/490)---------- Agent init Main: prepareAgent started Main: prepareAgent finished Main #A: method A() must be blocked on entering a synchronized statement TestTask.run: started Main #A.1: unsuspended Main: stopThread: StopThread returned code: JVMTI_ERROR_THREAD_NOT_SUSPENDED (13) Main #A.1: got expected THREAD_NOT_SUSPENDED Main #A.2: suspended Main: suspendThread Main: stopThread: StopThread returned code: JVMTI_ERROR_OPAQUE_FRAME (32) FAILED: Main #A.2: expected JVMTI_ERROR_NONE instead of: 32 ----------System.err:(13/725)---------- java.lang.RuntimeException: StopThreadTest failed! at StopThreadTest.throwFailed(StopThreadTest.java:80) at StopThreadTest.run(StopThreadTest.java:123) at StopThreadTest.main(StopThreadTest.java:85) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:578) at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138) at java.base/java.lang.Thread.run(Thread.java:1583) JavaTest Message: Test threw exception: java.lang.RuntimeException: StopThreadTest failed! JavaTest Message: shutting down test STATUS:Failed.`main' threw exception: java.lang.RuntimeException: StopThreadTest failed! ----------rerun:(34/6675)*---------- So this failure sighting is not a timeout, but is instead an unexpected JVM/TI return code: Main #A.2: suspended Main: suspendThread Main: stopThread: StopThread returned code: JVMTI_ERROR_OPAQUE_FRAME (32) FAILED: Main #A.2: expected JVMTI_ERROR_NONE instead of: 32
12-05-2023