RFR: 8296324: JVMTI GetStackTrace truncates vthread stack trace for agents loaded into running VM [v3]
Chris Plummer
cjplummer at openjdk.org
Fri Nov 18 19:37:20 UTC 2022
On Fri, 18 Nov 2022 07:23:20 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:
>> The `VirtualThread` static field `notifyJvmtiEvents` 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.
>
> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision:
>
> ajust condition when init_static_notify_jvmti_events() is called
Marked as reviewed by cjplummer (Reviewer).
src/hotspot/share/prims/jvmtiExport.cpp line 390:
> 388: java_lang_VirtualThread::init_static_notify_jvmti_events();
> 389: }
> 390: }
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.
-------------
PR: https://git.openjdk.org/jdk/pull/11204
More information about the hotspot-dev
mailing list