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

8275286: Check current thread when calling JRT methods that expect it #5949

Closed

Conversation

shipilev
Copy link
Contributor

@shipilev shipilev commented Oct 14, 2021

I found this oddity when porting Loom to x86_32. There are JRT entries that have JavaThread* current in their signature, and I believe that sets the expectation that JRT entry is to be called with the current thread as the argument. But, that is not mechanically checked, unless we call into some other class like ThreadInVMfromJava, etc. To simplify debugging, we should check current thread explicitly.

Additional testing:

  • Linux x86_64 fastdebug tier1
  • Linux x86_64 fastdebug tier2

Progress

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

Issue

  • JDK-8275286: Check current thread when calling JRT methods that expect it

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5949

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Oct 14, 2021

👋 Welcome back shade! 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 openjdk bot added the rfr label Oct 14, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Oct 14, 2021

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

  • hotspot-runtime

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-runtime label Oct 14, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Oct 14, 2021

Webrevs

Copy link
Contributor

@zhengyu123 zhengyu123 left a comment

Looks good to me.

@openjdk
Copy link

@openjdk openjdk bot commented Oct 14, 2021

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

8275286: Check current thread when calling JRT methods that expect it

Reviewed-by: zgu, coleenp, dholmes

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

  • c355704: 8041125: ColorConvertOp filter much slower in JDK 8 compared to JDK7
  • 9623d5b: 8275265: java/nio/channels tests needing large heap sizes fail on x86_32
  • 21df412: 8275240: Change nested classes in jdk.attach to static nested classes
  • a16f2d0: 8272908: Missing coverage for certain classes in com.sun.org.apache.xml.internal.security
  • ede3f4e: 8274795: AArch64: avoid spilling and restoring r18 in macro assembler
  • 40d69f0: 8254267: javax/xml/crypto/dsig/LogParameters.java failed with "RuntimeException: Unexpected log output:"
  • 54b8870: 8275035: Clean up worker thread infrastructure
  • 3b0b6ad: 8275226: Shenandoah: Relax memory constraint for worker claiming tasks/ranges

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Oct 14, 2021
Copy link
Contributor

@coleenp coleenp left a comment

Looks good to me.

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Yes it is a requirement/expectation that all JRT method callers manifest the current JavaThread to pass to the call.

David

@shipilev
Copy link
Contributor Author

@shipilev shipilev commented Oct 15, 2021

Thanks for reviews!

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Oct 15, 2021

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

  • c0f3e1d: 8271071: accessibility of a table on macOS lacks cell navigation
  • 4cb7124: 8262912: ciReplay: replay does not simulate unresolved classes
  • 322b130: 8275106: Cleanup Iterator usages in java.desktop
  • c355704: 8041125: ColorConvertOp filter much slower in JDK 8 compared to JDK7
  • 9623d5b: 8275265: java/nio/channels tests needing large heap sizes fail on x86_32
  • 21df412: 8275240: Change nested classes in jdk.attach to static nested classes
  • a16f2d0: 8272908: Missing coverage for certain classes in com.sun.org.apache.xml.internal.security
  • ede3f4e: 8274795: AArch64: avoid spilling and restoring r18 in macro assembler
  • 40d69f0: 8254267: javax/xml/crypto/dsig/LogParameters.java failed with "RuntimeException: Unexpected log output:"
  • 54b8870: 8275035: Clean up worker thread infrastructure
  • ... and 1 more: https://git.openjdk.java.net/jdk/compare/8d9004b7f4fd9b53d3f2240b382e7d71d7399125...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Oct 15, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Oct 15, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Oct 15, 2021

@shipilev Pushed as commit ced7909.

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

@shipilev shipilev deleted the JDK-8275286-check-current-jrt branch Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-runtime integrated
4 participants