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

8282200: ShouldNotReachHere() reached by AsyncGetCallTrace after JDK-8280422 #7559

Closed

Conversation

parttimenerd
Copy link
Contributor

@parttimenerd parttimenerd commented Feb 21, 2022

Fixes the mentioned bug by replacing the check in AsyncGetCallTrace using the newly introduced method JavaThread::thread_from_jni_environment.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8282200: ShouldNotReachHere() reached by AsyncGetCallTrace after JDK-8280422

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/7559/head:pull/7559
$ git checkout pull/7559

Update a local copy of the PR:
$ git checkout pull/7559
$ git pull https://git.openjdk.java.net/jdk pull/7559/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 7559

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/7559.diff

@parttimenerd parttimenerd changed the title JDK-8282200: ShouldNotReachHere() reached by AsyncGetCallTrace after JDK-8280422 8282200: ShouldNotReachHere() reached by AsyncGetCallTrace after 8280422 Feb 21, 2022
@bridgekeeper
Copy link

bridgekeeper bot commented Feb 21, 2022

👋 Welcome back parttimenerd! 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.

@parttimenerd parttimenerd changed the title 8282200: ShouldNotReachHere() reached by AsyncGetCallTrace after 8280422 8282200: ShouldNotReachHere() reached by AsyncGetCallTrace after JDK-8280422 Feb 21, 2022
@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 21, 2022
@openjdk
Copy link

openjdk bot commented Feb 21, 2022

@parttimenerd The following labels will be automatically applied to this pull request:

  • hotspot
  • serviceability

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added serviceability serviceability-dev@openjdk.org hotspot hotspot-dev@openjdk.org labels Feb 21, 2022
@mlbridge
Copy link

mlbridge bot commented Feb 21, 2022

Webrevs

@parttimenerd
Copy link
Contributor Author

Related to #7193

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

I marking this as changes requested because I need to investigate further. A shouldNotReachHere should never be reached, if it can be reached then the circumstances need investigated to see where the true problem lies.

Thanks,
David

@parttimenerd
Copy link
Contributor Author

I'm willing to help...

The described error is not dependent on the JVM being a debug build, I can also reproduce it with a release build by decreasing the sampling interval.

@dholmes-ora
Copy link
Member

Please see updates to JBS issue and the draft PR here:
#7566

You can either take my changes, or hand over to me and I will use my PR.

Thanks.

@parttimenerd
Copy link
Contributor Author

To be frank, I would like to integrate your changes into my, because I need a second PR for JDK to be able to write such issues in JBS on my own.

To the PR itself: The main difference between both is that with my PR we say "this should not happen please check before if you really want this" and with your PR we don't. I liked your initial PR that threw an error for the normal case that we cannot call this method for a thread in an inconsistent state. As you stated in the comment in the method of your PR, it is only a special case for AsyncGetCallTrace.

What is the down side of having to explicitly check for this special case when you need it and otherwise throw an error?

@dholmes-ora
Copy link
Member

I don't like unnecessary special-cases. I added the ShouldNotReachHere() due to flawed reasoning, so would like to remove it again and make the code look the way it would have if I had realized about AGCT at the time. Creating a new API just for AGCT to use is not necessary IMO.

Cheers.

@parttimenerd
Copy link
Contributor Author

Good to know. I will change my PR accordingly (if this ok for you) :)

@dholmes-ora
Copy link
Member

Please do update. Thanks.

@parttimenerd
Copy link
Contributor Author

parttimenerd commented Feb 23, 2022

I've updated it. Thanks again.

@parttimenerd parttimenerd force-pushed the parttimenerd_asgct_fix branch from 9f701eb to ca295d3 Compare February 23, 2022 15:48
@parttimenerd
Copy link
Contributor Author

I ran my original tests and found no crashes.

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Hi Johannes,

Your original changes need removing again.

Thanks,
David

src/hotspot/share/runtime/thread.hpp Outdated Show resolved Hide resolved
src/hotspot/share/runtime/thread.hpp Outdated Show resolved Hide resolved
Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Looks good to me (but I am biased :) )!

Thanks,
David

@openjdk
Copy link

openjdk bot commented Feb 23, 2022

@parttimenerd 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:

8282200: ShouldNotReachHere() reached by AsyncGetCallTrace after JDK-8280422

Reviewed-by: dholmes, mdoerr, kevinw

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 37 new commits pushed to the master branch:

  • f4486a1: 8262400: runtime/exceptionMsgs/AbstractMethodError/AbstractMethodErrorTest.java fails in test_ame5_compiled_vtable_stub with wrapper
  • 3cfffa4: 8282188: Unused static field MathContext.DEFAULT_DIGITS
  • 379fd85: 8277369: Strange behavior of JMenuBar with RIGHT_TO_LEFT orientation, arrow keys behaves opposite traversing through keyboard
  • cd3e59e: 8282299: Remove unused PartialArrayScanTask default constructor
  • a661003: 8281614: serviceability/sa/ClhsdbFindPC.java fails with java.lang.RuntimeException: 'In code in NMethod for jdk/test/lib/apps/LingeredApp.steadyState' missing from stdout/stderr
  • 43dc9ef: 8281988: Create a regression test for JDK-4618767
  • 253cf78: 8282076: Merge some debug agent changes from the loom repo
  • f86f38a: 8280901: MethodHandle::linkToNative stub is missing w/ -Xint
  • e540e0a: 8282296: (se) Pipe.open() creates a Pipe implementation that uses Unix domain sockets (win)
  • 7dc7184: 8282309: Operation before upper case conversion
  • ... and 27 more: https://git.openjdk.java.net/jdk/compare/cc7cf81256ed4d74493472017b1c4df20fa2208a...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 (@dholmes-ora, @TheRealMDoerr, @kevinjwalls) 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 Feb 23, 2022
Copy link
Contributor

@TheRealMDoerr TheRealMDoerr left a comment

Choose a reason for hiding this comment

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

LGTM.

src/hotspot/share/prims/forte.cpp Show resolved Hide resolved
@parttimenerd
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Feb 24, 2022
@openjdk
Copy link

openjdk bot commented Feb 24, 2022

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

@TheRealMDoerr
Copy link
Contributor

/sponsor

@openjdk
Copy link

openjdk bot commented Feb 24, 2022

Going to push as commit 231e48f.
Since your change was applied there have been 37 commits pushed to the master branch:

  • f4486a1: 8262400: runtime/exceptionMsgs/AbstractMethodError/AbstractMethodErrorTest.java fails in test_ame5_compiled_vtable_stub with wrapper
  • 3cfffa4: 8282188: Unused static field MathContext.DEFAULT_DIGITS
  • 379fd85: 8277369: Strange behavior of JMenuBar with RIGHT_TO_LEFT orientation, arrow keys behaves opposite traversing through keyboard
  • cd3e59e: 8282299: Remove unused PartialArrayScanTask default constructor
  • a661003: 8281614: serviceability/sa/ClhsdbFindPC.java fails with java.lang.RuntimeException: 'In code in NMethod for jdk/test/lib/apps/LingeredApp.steadyState' missing from stdout/stderr
  • 43dc9ef: 8281988: Create a regression test for JDK-4618767
  • 253cf78: 8282076: Merge some debug agent changes from the loom repo
  • f86f38a: 8280901: MethodHandle::linkToNative stub is missing w/ -Xint
  • e540e0a: 8282296: (se) Pipe.open() creates a Pipe implementation that uses Unix domain sockets (win)
  • 7dc7184: 8282309: Operation before upper case conversion
  • ... and 27 more: https://git.openjdk.java.net/jdk/compare/cc7cf81256ed4d74493472017b1c4df20fa2208a...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Feb 24, 2022
@openjdk openjdk bot closed this Feb 24, 2022
@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 Feb 24, 2022
@openjdk
Copy link

openjdk bot commented Feb 24, 2022

@TheRealMDoerr @parttimenerd Pushed as commit 231e48f.

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

@parttimenerd parttimenerd deleted the parttimenerd_asgct_fix branch April 8, 2022 09:15
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 serviceability serviceability-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

4 participants