-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8311218: fatal error: stuck in JvmtiVTMSTransitionDisabler::VTMS_transition_disable #17011
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
Changes from all commits
d85d5ca
1b56eea
64426f8
ccba940
18f1752
4e5f644
ad99042
917dc72
6f8cdf0
9ba94c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -317,6 +317,7 @@ class JavaThread: public Thread { | |
| volatile bool _carrier_thread_suspended; // Carrier thread is externally suspended | ||
| bool _is_in_VTMS_transition; // thread is in virtual thread mount state transition | ||
| bool _is_in_tmp_VTMS_transition; // thread is in temporary virtual thread mount state transition | ||
| bool _is_disable_suspend; // JVMTI suspend is temporarily disabled; used on current thread only | ||
| #ifdef ASSERT | ||
| bool _is_VTMS_transition_disabler; // thread currently disabled VTMS transitions | ||
| #endif | ||
|
|
@@ -647,6 +648,9 @@ class JavaThread: public Thread { | |
| void set_is_in_VTMS_transition(bool val); | ||
| void toggle_is_in_tmp_VTMS_transition() { _is_in_tmp_VTMS_transition = !_is_in_tmp_VTMS_transition; }; | ||
|
|
||
| bool is_disable_suspend() const { return _is_disable_suspend; } | ||
| void toggle_is_disable_suspend() { _is_disable_suspend = !_is_disable_suspend; }; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at this again then I don't think it can be a bit that is toggled on and off will work. Consider the case where several threads attempt to poll the state of a virtual Thread with Thread::getState at the same time. This can't work without an atomic counter and further coordination. So I think further work is required on this issue. Update: ignore this I mis-read that it updates the current thread's suspend value, not the thread's suspend value. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Thanks, Alan. I've also got confused with this and even filed a follow up bug. :) |
||
|
|
||
| #ifdef ASSERT | ||
| bool is_VTMS_transition_disabler() const { return _is_VTMS_transition_disabler; } | ||
| void set_is_VTMS_transition_disabler(bool val); | ||
|
|
@@ -811,6 +815,7 @@ class JavaThread: public Thread { | |
| #if INCLUDE_JVMTI | ||
| static ByteSize is_in_VTMS_transition_offset() { return byte_offset_of(JavaThread, _is_in_VTMS_transition); } | ||
| static ByteSize is_in_tmp_VTMS_transition_offset() { return byte_offset_of(JavaThread, _is_in_tmp_VTMS_transition); } | ||
| static ByteSize is_disable_suspend_offset() { return byte_offset_of(JavaThread, _is_disable_suspend); } | ||
| #endif | ||
|
|
||
| // Returns the jni environment for this thread | ||
|
|
||
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.
You can't do this! The Java code knows nothing about JVM TI being enabled/disabled and will call this function unconditionally.
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.
Indeed. I wonder if anyone is testing minimal builds to catch issues like this.
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.
Good catch, David!
Filed a cleanup bug: https://bugs.openjdk.org/browse/JDK-8322538
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.
Are these new compiler intrinsics required or an optional performance optimization? This PR creates issues for us when updating the JDK build for Graal. CC @davleopo
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.
Performance. If the intrinsic isn't there then some methods executed on virtual threads, or on a virtual thread as the target for some op, will have to call into the VM. The main concern was Thread.interrupted() as it gets called very frequently in locking and concurrency code.