Skip to content
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

JDK-8313796: AsyncGetCallTrace crash on unreadable interpreter method pointer #15193

Closed
wants to merge 7 commits into from

Conversation

richardstartin
Copy link
Contributor

@richardstartin richardstartin commented Aug 8, 2023

Makes AsyncGetCallTrace more resilient to method unloading.


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

Issue

  • JDK-8313796: AsyncGetCallTrace crash on unreadable interpreter method pointer (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15193/head:pull/15193
$ git checkout pull/15193

Update a local copy of the PR:
$ git checkout pull/15193
$ git pull https://git.openjdk.org/jdk.git pull/15193/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 15193

View PR using the GUI difftool:
$ git pr show -t 15193

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15193.diff

Webrev

Link to Webrev Comment

@richardstartin richardstartin changed the title JDK-8313796: AsyncGetCallTrace crash on unreadable interpreter method… JDK-8313796: AsyncGetCallTrace crash on unreadable interpreter method pointer Aug 8, 2023
@bridgekeeper
Copy link

bridgekeeper bot commented Aug 8, 2023

👋 Welcome back richardstartin! 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 Aug 8, 2023

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

  • hotspot

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.

@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label Aug 8, 2023
@richardstartin richardstartin marked this pull request as ready for review August 8, 2023 17:50
@openjdk openjdk bot added the rfr Pull request is ready for review label Aug 8, 2023
@mlbridge
Copy link

mlbridge bot commented Aug 8, 2023

Webrevs

Copy link
Contributor

@coleenp coleenp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a new function like frame::interpreter_frame_method_safe() or frame::safe_interpreter_frame_method() and put this code in shared/runtime ?

Copy link
Contributor

@theRealAph theRealAph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks.

@openjdk
Copy link

openjdk bot commented Aug 8, 2023

@richardstartin This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8313796: AsyncGetCallTrace crash on unreadable interpreter method pointer

Reviewed-by: coleenp, aph, stuefe

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 26 new commits pushed to the master branch:

  • 6e3cc13: 8312467: relax the builddir check in make/autoconf/basic.m4
  • 77e5739: 8310118: Resource files should be moved to appropriate directories
  • 96304f3: 8313691: use close after failing os::fdopen in vmError and ciEnv
  • 3fb4805: 8307462: [REDO] VmObjectAlloc is not generated by intrinsics methods which allocate objects
  • 0a42c44: 8313954: Add gc logging to vmTestbase/vm/gc/containers/Combination05
  • 735b16a: 8313752: InstanceKlassFlags::print_on doesn't print the flag names
  • d3b578f: 8313345: SuperWord fails due to CMove without matching Bool pack
  • 31a307f: 8306441: Two phase segmented heap dump
  • 515add8: 8313206: PKCS11 tests silently skip execution
  • 6864441: 8313809: String template fails with java.lang.StringIndexOutOfBoundsException if last fragment is UTF16
  • ... and 16 more: https://git.openjdk.org/jdk/compare/0bb6af3bc0fa608c4a988fee9c0f10947e899e2e...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@coleenp, @theRealAph, @tstuefe) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Aug 8, 2023
Copy link
Contributor

@coleenp coleenp 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. Thank you for taking my suggestion.

Copy link
Member

@tstuefe tstuefe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nit, otherwise good.

return nullptr;
}
Method* m = (Method*) SafeFetchN((intptr_t*) m_addr, 0);
if (m == 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nits:

  • nullptr instead of 0
  • you can just return m. Its either nullptr or the Method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This didn't compile: error: cannot convert 'std::nullptr_t' to 'intptr_t' {aka 'long int'} - I put it back to the literal 0.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(void*)nullptr is probably best, with 0 it is not directly obvious, that it is a pointer.

@richardstartin
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Aug 9, 2023
@openjdk
Copy link

openjdk bot commented Aug 9, 2023

@richardstartin
Your change (at version ad96b72) is now ready to be sponsored by a Committer.

@tstuefe
Copy link
Member

tstuefe commented Aug 9, 2023

/sponsor

@openjdk
Copy link

openjdk bot commented Aug 9, 2023

Going to push as commit 0e2c72d.
Since your change was applied there have been 28 commits pushed to the master branch:

  • 52ec4bc: 8303056: Improve support for Unicode characters and digits in JavaDoc search
  • 9cf12bb: 8313922: Remove unused WorkerPolicy::_debug_perturbation
  • 6e3cc13: 8312467: relax the builddir check in make/autoconf/basic.m4
  • 77e5739: 8310118: Resource files should be moved to appropriate directories
  • 96304f3: 8313691: use close after failing os::fdopen in vmError and ciEnv
  • 3fb4805: 8307462: [REDO] VmObjectAlloc is not generated by intrinsics methods which allocate objects
  • 0a42c44: 8313954: Add gc logging to vmTestbase/vm/gc/containers/Combination05
  • 735b16a: 8313752: InstanceKlassFlags::print_on doesn't print the flag names
  • d3b578f: 8313345: SuperWord fails due to CMove without matching Bool pack
  • 31a307f: 8306441: Two phase segmented heap dump
  • ... and 18 more: https://git.openjdk.org/jdk/compare/0bb6af3bc0fa608c4a988fee9c0f10947e899e2e...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Aug 9, 2023
@openjdk openjdk bot closed this Aug 9, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Aug 9, 2023
@openjdk
Copy link

openjdk bot commented Aug 9, 2023

@tstuefe @richardstartin Pushed as commit 0e2c72d.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@richardstartin
Copy link
Contributor Author

Thanks for the helpful reviews and for sponsoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated
5 participants