-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8365192: post_meth_exit should be in vm state when calling get_jvmti_thread_state #26713
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
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 |
---|---|---|
|
@@ -420,6 +420,7 @@ JvmtiExport::get_jvmti_interface(JavaVM *jvm, void **penv, jint version) { | |
JvmtiThreadState* | ||
JvmtiExport::get_jvmti_thread_state(JavaThread *thread, bool allow_suspend) { | ||
assert(thread == JavaThread::current(), "must be current thread"); | ||
assert(thread->thread_state() == _thread_in_vm, "thread should be in vm"); | ||
if (thread->is_vthread_mounted() && thread->jvmti_thread_state() == nullptr) { | ||
JvmtiEventController::thread_started(thread); | ||
if (allow_suspend && thread->is_suspended()) { | ||
|
@@ -1831,8 +1832,11 @@ void JvmtiExport::post_method_exit(JavaThread* thread, Method* method, frame cur | |
HandleMark hm(thread); | ||
methodHandle mh(thread, method); | ||
|
||
JvmtiThreadState *state = get_jvmti_thread_state(thread); | ||
|
||
JvmtiThreadState *state = nullptr; | ||
{ | ||
ThreadInVMfromJava __tiv(thread); | ||
state = get_jvmti_thread_state(thread); | ||
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. The issue I see is that 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. Thank you, Patricio! Good catch and suggestion. 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. This can be kind of intrusive, something like below (without changes from Leonid):
The comments also need to be corrected. 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. |
||
} | ||
if (state == nullptr || !state->is_interp_only_mode()) { | ||
// for any thread that actually wants method exit, interp_only_mode is set | ||
return; | ||
|
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.
Nit: Maybe rename:
__tiv
=>tiv
. The prefix__
is normally used in macros to avoid potential naming conflicts.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.
Thank you for the update on this!