8386116: vm/jvmti/StopThread/stop001/stop00103/stop00103a.html trips assert(!java_lang_Thread::is_in_vthread_transition(vthread)) failed#31519
Conversation
|
👋 Welcome back pchilanomate! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
@pchilano The following labels will be automatically applied to this pull request:
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. |
|
The total number of required reviews for this PR has been set to 2 based on the presence of this label: |
|
/label remove core-libs |
|
@pchilano |
| } | ||
|
|
||
| if (is_virtual && java_thread->on_monitor_waited_event()) { | ||
| // The exception might end up been thrown in the carrier |
An asynchronous exception handshake can be installed by JVMTI
StopThreadon a virtual thread blocked inMountUnmountDisabler::start_transitionwhile trying to start an unmount transition inyieldContinuation. In that case, the handshake will be processed and the exception thrown outside thetryblock inyieldContinuation. Since the transition bits remain set, the virtual thread will hit the reported assert at the next unmount attempt.The fix is to move
startTransitioninside thetryblock inyieldContinuationso thatendTransitionis executed in case of an exception.Note that calls to
MountUnmountDisabler::start_transitionfor the mount case are not an issue becauseStopThreaddoes not work on an unmounted virtual thread.I added a test that reproduces the crash without this fix. I also tested the patch in mach5 tiers1-6.
Thanks,
Patricio
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/31519/head:pull/31519$ git checkout pull/31519Update a local copy of the PR:
$ git checkout pull/31519$ git pull https://git.openjdk.org/jdk.git pull/31519/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 31519View PR using the GUI difftool:
$ git pr show -t 31519Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/31519.diff