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

8285794: AsyncGetCallTrace might acquire a lock via JavaThread::thread_from_jni_environment #8446

Closed

Conversation

parttimenerd
Copy link
Contributor

@parttimenerd parttimenerd commented Apr 28, 2022

Calling JavaThread::thread_from_jni_environment for a terminated thread in AsyncGetCallTrace might cause the acquisition of a lock, making AsyncGetCallTrace non-signal-safe.

AsyncGetCallTrace can only be called for the current threads (there are asserts for that), therefore using JavaThread::current directly and checking the termination status is semantically equivalent.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (1 review required, with at least 1 reviewer)

Issue

  • JDK-8285794: AsyncGetCallTrace might acquire a lock via JavaThread::thread_from_jni_environment

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 8446

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

Using diff file

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

Calling JavaThread::thread_from_jni_environment for
a terminated thread might cause the aquisition of a lock.
Calling JavaThread::current does not have this problem
and AsyncGetCallTrace can only be called on the current
thread anyway.
@bridgekeeper
Copy link

bridgekeeper bot commented Apr 28, 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.

@openjdk openjdk bot added the rfr label Apr 28, 2022
@openjdk
Copy link

openjdk bot commented Apr 28, 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 hotspot labels Apr 28, 2022
@mlbridge
Copy link

mlbridge bot commented Apr 28, 2022

Webrevs

src/hotspot/share/prims/forte.cpp Outdated Show resolved Hide resolved
src/hotspot/share/prims/forte.cpp Outdated Show resolved Hide resolved
src/hotspot/share/prims/forte.cpp Show resolved Hide resolved
src/hotspot/share/prims/forte.cpp Outdated Show resolved Hide resolved
src/hotspot/share/prims/forte.cpp Outdated Show resolved Hide resolved
Copy link
Member

@dholmes-ora dholmes-ora left a comment

Looks good.

Thanks.

@openjdk
Copy link

openjdk bot commented May 3, 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:

8285794: AsyncGetCallTrace might acquire a lock via JavaThread::thread_from_jni_environment

Reviewed-by: dholmes, mdoerr, jbachorik

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

  • 1ce72ea: 8281297: TestStressG1Humongous fails with guarantee(is_range_uncommitted)
  • cdd1b0d: 8284613: invalid use of @serial tag
  • 9583e36: 8284161: Implementation of Virtual Threads (Preview)
  • 5212535: 8282218: C1: Missing side effects of dynamic class loading during constant linkage
  • d8f9686: 8286342: ProblemList compiler/c2/irTests/TestEnumFinalFold.java
  • bb52ea6: 8286263: compiler/c1/TestPinnedIntrinsics.java failed with "RuntimeException: testCurrentTimeMillis failed with -3"
  • 5a1d8f7: 8285295: Need better testing for IdentityHashMap
  • 080f3c5: 8286190: Add test to verify constant folding for Enum fields
  • 1277f5d: 8286154: Fix 3rd party notices in test files
  • 2dd4dfd: 8286291: G1: Remove unused segment allocator printouts
  • ... and 118 more: https://git.openjdk.java.net/jdk/compare/5629c7555f9bb779c57f45dfb071abbb1d87bb7d...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, @jbachorik) 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 label May 3, 2022
@parttimenerd
Copy link
Contributor Author

parttimenerd commented May 3, 2022

/integrate

@openjdk openjdk bot added the sponsor label May 3, 2022
@openjdk
Copy link

openjdk bot commented May 3, 2022

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

Copy link
Contributor

@TheRealMDoerr TheRealMDoerr left a comment

LGTM.

src/hotspot/share/prims/forte.cpp Outdated Show resolved Hide resolved
@openjdk openjdk bot removed the sponsor label May 5, 2022
@parttimenerd
Copy link
Contributor Author

parttimenerd commented May 9, 2022

/integrate

@openjdk openjdk bot added the sponsor label May 9, 2022
@openjdk
Copy link

openjdk bot commented May 9, 2022

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

@TheRealMDoerr
Copy link
Contributor

TheRealMDoerr commented May 9, 2022

/sponsor

@openjdk
Copy link

openjdk bot commented May 9, 2022

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

  • 39f4434: 8286312: Stop mixing signed and unsigned types in bit operations
  • b490a58: 8283899: Revert 8284190 after fix of 8281297
  • 1ce72ea: 8281297: TestStressG1Humongous fails with guarantee(is_range_uncommitted)
  • cdd1b0d: 8284613: invalid use of @serial tag
  • 9583e36: 8284161: Implementation of Virtual Threads (Preview)
  • 5212535: 8282218: C1: Missing side effects of dynamic class loading during constant linkage
  • d8f9686: 8286342: ProblemList compiler/c2/irTests/TestEnumFinalFold.java
  • bb52ea6: 8286263: compiler/c1/TestPinnedIntrinsics.java failed with "RuntimeException: testCurrentTimeMillis failed with -3"
  • 5a1d8f7: 8285295: Need better testing for IdentityHashMap
  • 080f3c5: 8286190: Add test to verify constant folding for Enum fields
  • ... and 120 more: https://git.openjdk.java.net/jdk/compare/5629c7555f9bb779c57f45dfb071abbb1d87bb7d...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated label May 9, 2022
@openjdk openjdk bot closed this May 9, 2022
@openjdk openjdk bot removed ready rfr sponsor labels May 9, 2022
@openjdk
Copy link

openjdk bot commented May 9, 2022

@TheRealMDoerr @parttimenerd Pushed as commit d4474b5.

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

@parttimenerd parttimenerd deleted the parttimenerd_8285794 branch May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot integrated serviceability
4 participants