-
Notifications
You must be signed in to change notification settings - Fork 722
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
[JDK20/21] Add support for JVMTI Local Variable functions #17829
[JDK20/21] Add support for JVMTI Local Variable functions #17829
Conversation
Since JDK20, all JVMTI Local Variable functions are expected to return JVMTI_ERROR_THREAD_NOT_SUSPENDED if the thread was not suspended and was not the current thread. Also, there is no need to halt and resume the thread for inspection since these functions expect the thread to be suspended. Related: eclipse-openj9#17711 Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
Timeline to illustrate change in JVMTI spec behaviourJDK8 - https://docs.oracle.com/javase/8/docs/platform/jvmti/jvmti.html#local
JDK20 - https://docs.oracle.com/en/java/javase/20/docs/specs/jvmti.html#local |
@gacholio Requesting your review. |
This does not address being suspended by java. In the past, suspension by java or JVMTI was indistiguishable (making the whole thing extremely unreliable). Please verify that the two are still identical for normal threads, which would require changes to this PR. |
Are suspend and resume even legal in java in the latest releases? |
Since JDK20, java.lang.Thread.resume and java.lang.Thread.suspend throw
In JDK20+, |
jenkins test sanity zlinux jdk8,jdk21 |
There's rather a lot of failures in the JDK21 testing. |
I only see one failure in testJitserverArguments_0 due to "Connection refused", which seems unrelated to this change. |
Yes, I'm misreading the output. |
- 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 <sbabneet@ca.ibm.com>
- 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 <sbabneet@ca.ibm.com>
- 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 <sbabneet@ca.ibm.com>
Since JDK20, all JVMTI Local Variable functions are expected to return
JVMTI_ERROR_THREAD_NOT_SUSPENDED if the thread was not suspended and
was not the current thread.
Also, there is no need to halt and resume the thread for inspection
since these functions expect the thread to be suspended.
Related: #17711