-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8362304: Fix JDWP spec w.r.t. OPAQUE_FRAME and INVALID_SLOT errors #26336
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
base: master
Are you sure you want to change the base?
Conversation
/csr needed |
👋 Welcome back cjplummer! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
@plummercj has indicated that a compatibility and specification (CSR) request is needed for this pull request. @plummercj please create a CSR request for issue JDK-8362304 with the correct fix version. This pull request cannot be integrated until the CSR request is approved. |
@plummercj The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
/label add serviceability |
/label remove core-libs |
@plummercj |
@plummercj |
Ping. just triggering first email to serviceability-dev. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. Also, I'll wait for CSR to review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated version looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The update looks good.
I think, this issue needs a Release Note, same as the JNI related enhancement. Not sure about the JVMTI related spec update as it has pure spec clarifications which do not have even minor compatibility issues. |
I agree. Also one release note to cover the 3 interfaces would be clearer than separate notes. |
Keep in mind that the APIs in question do not map 1-to-1 across these interfaces. For example, NativeMethodException is unique to JDI, and JDI get/setValue() is implemented such that it cannot end up failing due to NativeMethodException. Also, JDI needed implementation changes whereas JVMTI and JDWP did not. |
StackFrame.SetValues, StackFrame.GetValues, ThreadReference.PopFrames, and ThreadReference.ForceEarlyReturn all need updated language related to OPAQUE_FRAME error.
(1) The spec for JVMTI says the following for GetLocalsXXX and SetLocalsXXX
The implementation is unable to set the frame locals
(e.g. the frame at depth is executing a native method).
However, the JDWP StackFrame.SetValues and GetValues commands only mention OPAQUE_FRAME for SetValues when not called for the topmost frame of a virtual thread suspended at an event. I don't think there is anything to prevent OPAQUE_FRAME due to the thread being native or some other reason as mentioned in the JVMTI spec. The JDWP spec should be updated to reflect this.
(1) The spec for JVMTI says the following for PopFrame and ForceEarlyReturn:
The implementation is unable to force the current frame to return
(e.g. current frame is executing a native method).
However, the JDWP ThreadReference.PopFrames, and ThreadReference.ForceEarlyReturn commands only mention OPAQUE_FRAME when this commands are not called for the topmost frame of a virtual thread suspended at an event. I don't think there is anything to prevent OPAQUE_FRAME due to the thread being native or some other reason as mentioned in the JVMTI spec. The JDWP spec should be updated to reflect this.
(3) Another issue is that INVALID_SLOT is missing in the JDWP spec for SetValues, but is there for GetValues. It should be mentioned for both commands.
Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26336/head:pull/26336
$ git checkout pull/26336
Update a local copy of the PR:
$ git checkout pull/26336
$ git pull https://git.openjdk.org/jdk.git pull/26336/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 26336
View PR using the GUI difftool:
$ git pr show -t 26336
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26336.diff
Using Webrev
Link to Webrev Comment