-
Notifications
You must be signed in to change notification settings - Fork 728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JDK21] Add support for JVMTI StopThread #17806
[JDK21] Add support for JVMTI StopThread #17806
Conversation
e03b95b
to
a15c1ef
Compare
Test code associated to the above behaviour: Verified locally that StopThreadTest passes with the changes from this PR. |
JDK21 JVMTI Specification for StopThread: https://download.java.net/java/early_access/jdk21/docs/specs/jvmti.html#StopThread |
@gacholio Requesting to review. |
Previously, StopThread returned JVMTI_ERROR_UNSUPPORTED_OPERATION for a virtual thread. In JDK21, StopThread includes support for virtual threads as per the JVMTI specification: - Error if a virtual thread is not suspended and not the current thread. - Error if a virtual thread is unomunted since it won't be able to throw an asynchronous exception from the current frame. Related: - eclipse-openj9#17717 - eclipse-openj9#17718 Also, StopThread should not clear the J9_PUBLIC_FLAGS_HALT_THREAD_JAVA_SUSPEND flag. This behaviour is not documented in the JVMTI specification. It causes incorrect behaviour for ResumeThread when the following sequence of JVMTI functions are invoked: SuspendThread -> StopThread -> ResumeThread. Signed-off-by: Babneet Singh <[email protected]>
a15c1ef
to
a9f1c91
Compare
jenkins test sanity zlinux jdk8,jdk21 |
- StopThreadTest fixed by eclipse-openj9/openj9#17806 - PopFrameTest fixed by eclipse-openj9/openj9#17809 - GetSetLocalUnsuspended fixed by eclipse-openj9/openj9#17829 Closes eclipse-openj9/openj9#17711 Closes eclipse-openj9/openj9#17715 Closes eclipse-openj9/openj9#17716 Closes eclipse-openj9/openj9#17717 Closes eclipse-openj9/openj9#17718 Signed-off-by: Babneet Singh <[email protected]>
- StopThreadTest is fixed by eclipse-openj9/openj9#17806. - PopFrameTest is fixed by eclipse-openj9/openj9#17809. - GetSetLocalUnsuspended is fixed by eclipse-openj9/openj9#17829. Closes eclipse-openj9/openj9#17711 Closes eclipse-openj9/openj9#17715 Closes eclipse-openj9/openj9#17716 Closes eclipse-openj9/openj9#17717 Closes eclipse-openj9/openj9#17718 Signed-off-by: Babneet Singh <[email protected]>
- StopThreadTest is fixed by eclipse-openj9/openj9#17806. - PopFrameTest is fixed by eclipse-openj9/openj9#17809. - GetSetLocalUnsuspended is fixed by eclipse-openj9/openj9#17829. Closes eclipse-openj9/openj9#17711 Closes eclipse-openj9/openj9#17715 Closes eclipse-openj9/openj9#17716 Closes eclipse-openj9/openj9#17717 Closes eclipse-openj9/openj9#17718 Signed-off-by: Babneet Singh <[email protected]>
Previously, StopThread returned JVMTI_ERROR_UNSUPPORTED_OPERATION for
a virtual thread.
In JDK21, StopThread includes support for virtual threads as per the
JVMTI specification:
thread.
throw an asynchronous exception from the current frame.
Related:
Also, StopThread should not clear the
J9_PUBLIC_FLAGS_HALT_THREAD_JAVA_SUSPEND flag. This behaviour is not
documented in the JVMTI specification. It causes incorrect behaviour
for ResumeThread when the following sequence of JVMTI functions are
invoked: SuspendThread -> StopThread -> ResumeThread.