On Fri, 24 Mar 2023 02:00:57 GMT, Serguei Spitsyn <sspit...@openjdk.org> wrote:

>> src/hotspot/share/prims/jvmtiEnvBase.cpp line 1581:
>> 
>>> 1579:     return false;
>>> 1580:   }
>>> 1581:   if (JvmtiVTMSTransitionDisabler::VTMS_notify_jvmti_events()) {
>> 
>> shouldn't be
>>  if (!JvmtiVTMSTransitionDisabler::VTMS_notify_jvmti_events()) {
>> here?
>
> This is nice catch, thanks!

Fixed it now and discovered some issues which have not seen before.
It occurred that disabling notifyJvmti events when virtual threads are executed 
is unsafe.
It is not easy to fix these issue and there is no real need to.
So that I've refactored the test to do multiple testing cycles.
Each testing cycle disables notifyJvmti events when there are no virtual 
threads executed then starts a number of threads, then enables notifyJvmti 
events and shuts down the virtual threads.
The test also extended to post more JVMTI events:  `VirtualThreadStart`, 
`VirtualThreadEnd`, `ThreadStart` and `ThreadEnd`.
Also, I saw some intermittent crashes with double-deallocation of 
JvmtiThreadState's which belongs to vthreads.
So that, I have extend the VM_InitNotifyJvmtiEventsMode to do more corrections.
Will push my fixes after my mach5 test runs are finished.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/13133#discussion_r1149975274

Reply via email to