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
8303086: SIGSEGV in JavaThread::is_interp_only_mode() #14728
Conversation
👋 Welcome back sspitsyn! A progress list of the required criteria for merging this PR into |
There was a problem hiding this 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!
Patricio
@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:
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 6 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
Patricio, Chris and Leonid, thank you for review. |
/integrate |
Going to push as commit 971c2ef.
Your commit was automatically rebased without conflicts. |
@@ -575,7 +575,7 @@ JvmtiEnv::SetEventNotificationMode(jvmtiEventMode mode, jvmtiEvent event_type, j | |||
if (event_type == JVMTI_EVENT_CLASS_FILE_LOAD_HOOK && enabled) { | |||
record_class_file_load_hook_enabled(); | |||
} | |||
JvmtiVTMSTransitionDisabler disabler(event_thread); | |||
JvmtiVTMSTransitionDisabler disabler; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An explanatory comment would have been good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix has been already integrated.
I'll add a comment when there is a chance.
/backport jdk21 |
@sspitsyn the backport was successfully created on the branch sspitsyn-backport-971c2efb in my personal fork of openjdk/jdk21. To create a pull request with this backport targeting openjdk/jdk21:master, just click the following link: The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:
If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk21:
|
The JVMTI function
SetEventNotificationMode
can set notification mode globally (event_thread == nullptr
) for all threads or for a specific thread (event_thread != nullptr
). To get a stable mount/unmount vision of virtual threads a JvmtiVTMSTransitionDisabler helper object is created :JvmtiVTMSTransitionDisabler disabler(event_thread);
In a case if
event_thread == nullptr
the VTMS transitions are disabled for all virtual thread,otherwise they are disabled for a specific thread if it is virtual.
The call to
JvmtiEventController::set_user_enabled()
makes a call torecompute_enabled()
at the end of its work to do a required bookkeeping. As part of this work, therecompute_thread_enabled(state)
is called for each thread from theThreadsListHandle
, not only for the givenevent_thread
:This can cause crashes as VTMS transitions for other virtual threads are allowed.
Crashes are observed in this small function:
In a case
_thread != nullptr
then the call needs to be executed:_thread->is_interp_only_mode()
.But the filed
_thread
can be already changed tonullptr
by a VTMS transition.The fix is to always disable all transitions.
Thanks to Dan and Patricio for great analysis of this crash!
Testing:
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/14728/head:pull/14728
$ git checkout pull/14728
Update a local copy of the PR:
$ git checkout pull/14728
$ git pull https://git.openjdk.org/jdk.git pull/14728/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 14728
View PR using the GUI difftool:
$ git pr show -t 14728
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/14728.diff
Webrev
Link to Webrev Comment