Skip to content

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

plummercj
Copy link
Contributor

@plummercj plummercj commented Jul 15, 2025

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

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change requires CSR request JDK-8362656 to be approved

Issues

  • JDK-8362304: Fix JDWP spec w.r.t. OPAQUE_FRAME and INVALID_SLOT errors (Bug - P4)
  • JDK-8362656: Fix JDWP spec w.r.t. OPAQUE_FRAME and INVALID_SLOT errors (CSR)

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

@plummercj
Copy link
Contributor Author

/csr needed

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 15, 2025

👋 Welcome back cjplummer! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jul 15, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot changed the title 8362304 8362304: Fix JDWP spec w.r.t. OPAQUE_FRAME and INVALID_SLOT errors Jul 15, 2025
@openjdk openjdk bot added rfr Pull request is ready for review csr Pull request needs approved CSR before integration labels Jul 15, 2025
@openjdk
Copy link

openjdk bot commented Jul 15, 2025

@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.

@openjdk
Copy link

openjdk bot commented Jul 15, 2025

@plummercj The following label will be automatically applied to this pull request:

  • core-libs

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.

@mlbridge
Copy link

mlbridge bot commented Jul 15, 2025

Webrevs

@plummercj
Copy link
Contributor Author

/label add serviceability

@plummercj
Copy link
Contributor Author

/label remove core-libs

@openjdk
Copy link

openjdk bot commented Jul 15, 2025

@plummercj
The serviceability label was successfully added.

@openjdk
Copy link

openjdk bot commented Jul 15, 2025

@plummercj
The core-libs label was successfully removed.

@plummercj
Copy link
Contributor Author

Ping. just triggering first email to serviceability-dev.

Copy link
Contributor

@sspitsyn sspitsyn left a 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.

Copy link
Contributor

@AlanBateman AlanBateman left a 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.

Copy link
Contributor

@sspitsyn sspitsyn left a 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.

@sspitsyn
Copy link
Contributor

sspitsyn commented Jul 24, 2025

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.

@AlanBateman
Copy link
Contributor

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.

@plummercj
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
csr Pull request needs approved CSR before integration rfr Pull request is ready for review serviceability [email protected]
Development

Successfully merging this pull request may close these issues.

4 participants