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

8293339: vm/jvmti/StopThread/stop001/stop00103 crashes with SIGSEGV in Continuation::is_continuation_mounted #10235

Closed
wants to merge 1 commit into from

Conversation

sspitsyn
Copy link
Contributor

@sspitsyn sspitsyn commented Sep 10, 2022

I was not able to reproduce this issue in thousands of mach5 runs on multiple platforms. However, the root cause seems to be pretty simple. A JvmtiVTMSTransitionDisabler needs to be added to make the JVM TI StopThread function to be VTMS (Virtual Thread Mount state) transition safe.

So the fix is a one-liner:

diff --git a/src/hotspot/share/prims/jvmtiEnv.cpp b/src/hotspot/share/prims/jvmtiEnv.cpp
index a9efe01c92e..f5e9176230a 100644
--- a/src/hotspot/share/prims/jvmtiEnv.cpp
+++ b/src/hotspot/share/prims/jvmtiEnv.cpp
@@ -1182,6 +1182,8 @@ JvmtiEnv::ResumeAllVirtualThreads(jint except_count, const jthread* except_list)
 jvmtiError
 JvmtiEnv::StopThread(jthread thread, jobject exception) {
   JavaThread* current_thread = JavaThread::current();
+
+  JvmtiVTMSTransitionDisabler disabler;
   ThreadsListHandle tlh(current_thread);
   JavaThread* java_thread = NULL;
   oop thread_oop = NULL;

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-8293339: vm/jvmti/StopThread/stop001/stop00103 crashes with SIGSEGV in Continuation::is_continuation_mounted

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10235

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 10, 2022

👋 Welcome back sspitsyn! 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 Pull request is ready for review label Sep 10, 2022
@openjdk
Copy link

openjdk bot commented Sep 10, 2022

@sspitsyn 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 Sep 10, 2022
@mlbridge
Copy link

mlbridge bot commented Sep 10, 2022

Webrevs

@openjdk
Copy link

openjdk bot commented Sep 12, 2022

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

8293339: vm/jvmti/StopThread/stop001/stop00103 crashes with SIGSEGV in Continuation::is_continuation_mounted

Reviewed-by: cjplummer, lmesnik

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

  • 524af94: 8283627: Outdated comment in MachineDescriptionTwosComplement.isLP64
  • cea409c: 8292738: JInternalFrame backgroundShadowBorder & foregroundShadowBorder line is longer in Mac Look and Feel
  • 9ef6c09: 8287908: Use non-cloning reflection methods where acceptable
  • 0c61bf1: 8293282: LoadLibraryUnloadTest.java fails with "Too few cleared WeakReferences"
  • 91c9091: 8293343: sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.java failed with "Agent communication error: java.io.EOFException"
  • 4c77bd3: 6529151: NullPointerException in swing.plaf.synth.SynthLookAndFeel$Handler
  • d5aae01: 8293544: G1: Add comment in G1BarrierSetC1::pre_barrier
  • 37df5f5: 8291599: Assertion in PhaseIdealLoop::skeleton_predicate_has_opaque after JDK-8289127
  • 699c429: 8292866: Java_sun_awt_shell_Win32ShellFolder2_getLinkLocation check MultiByteToWideChar return value for failures
  • 68da02c: 8292240: CarrierThread.blocking not reset when spare not activated

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 Pull request is ready to be integrated label Sep 12, 2022
@sspitsyn
Copy link
Contributor Author

Chris and Leonid, thank you for review!

@sspitsyn
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Sep 12, 2022

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

  • 524af94: 8283627: Outdated comment in MachineDescriptionTwosComplement.isLP64
  • cea409c: 8292738: JInternalFrame backgroundShadowBorder & foregroundShadowBorder line is longer in Mac Look and Feel
  • 9ef6c09: 8287908: Use non-cloning reflection methods where acceptable
  • 0c61bf1: 8293282: LoadLibraryUnloadTest.java fails with "Too few cleared WeakReferences"
  • 91c9091: 8293343: sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.java failed with "Agent communication error: java.io.EOFException"
  • 4c77bd3: 6529151: NullPointerException in swing.plaf.synth.SynthLookAndFeel$Handler
  • d5aae01: 8293544: G1: Add comment in G1BarrierSetC1::pre_barrier
  • 37df5f5: 8291599: Assertion in PhaseIdealLoop::skeleton_predicate_has_opaque after JDK-8289127
  • 699c429: 8292866: Java_sun_awt_shell_Win32ShellFolder2_getLinkLocation check MultiByteToWideChar return value for failures
  • 68da02c: 8292240: CarrierThread.blocking not reset when spare not activated

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Sep 12, 2022
@openjdk openjdk bot closed this Sep 12, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 12, 2022
@openjdk
Copy link

openjdk bot commented Sep 12, 2022

@sspitsyn Pushed as commit d3f7e3b.

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

@sspitsyn sspitsyn deleted the br9 branch September 12, 2022 22:03
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.

3 participants