-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8296324: JVMTI GetStackTrace truncates vthread stack trace for agents loaded into running VM #11204
Conversation
… loaded into running VM
👋 Welcome back sspitsyn! A progress list of the required criteria for merging this PR into |
Webrevs
|
.../hotspot/jtreg/serviceability/jvmti/vthread/VirtualStackTraceTest/VirtualStackTraceTest.java
Show resolved
Hide resolved
@@ -382,7 +382,13 @@ JvmtiExport::get_jvmti_interface(JavaVM *jvm, void **penv, jint version) { | |||
} | |||
if (Continuations::enabled()) { | |||
// Virtual threads support. There is a performance impact when VTMS transitions are enabled. | |||
java_lang_VirtualThread::set_notify_jvmti_events(true); | |||
if (!java_lang_VirtualThread ::notify_jvmti_events()) { |
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.
remove extra space before ::
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. Will fix it.
if (JvmtiEnv::get_phase() == JVMTI_PHASE_LIVE) { | ||
ThreadInVMfromNative __tiv(JavaThread::current()); | ||
java_lang_VirtualThread::init_static_notify_jvmti_events(); | ||
} | ||
} |
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.
Yes, this looks good now. Removing the if (!java_lang_VirtualThread ::notify_jvmti_events())
check means the init_static_notify_jvmti_events()
can still be called on subsequent calls to this method. So if init_static_notify_jvmti_events()
was not called the first time (due to not being in the LIVE phase), then it can still be called on subsequent calls to this method if not in the LIVE phase.
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.
Okay. Thank you for the review, Chris,
@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 379 new commits pushed to the
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 |
Thank you for review, Leonid. |
/integrate |
Going to push as commit 035eaee.
Your commit was automatically rebased without conflicts. |
The
VirtualThread
static fieldnotifyJvmtiEvents
is not set correctly in cases JVMTI agents are loaded into running VM. It is because an extra call to java_lang_VirtualThread::init_static_notify_jvmti_events() is needed.This function is called once at the VM initialization, so this extra call is not necessary for agent loaded at startup.
Testing:
New test is added:
test/hotspot/jtreg/serviceability/jvmti/vthread/VirtualStackTraceTest
This test is failed without fix and passed with it.
TBD: run all JVMTI and JDI test in mach5.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/11204/head:pull/11204
$ git checkout pull/11204
Update a local copy of the PR:
$ git checkout pull/11204
$ git pull https://git.openjdk.org/jdk pull/11204/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 11204
View PR using the GUI difftool:
$ git pr show -t 11204
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/11204.diff