RFR: 8341273: JVMTI is not properly hiding some continuation related methods

Serguei Spitsyn sspitsyn at openjdk.org
Wed Oct 9 07:57:57 UTC 2024


On Mon, 7 Oct 2024 23:43:23 GMT, Leonid Mesnik <lmesnik at openjdk.org> wrote:

>> This fixes a problem in the VTMS (Virtual Thread Mount State) transition frames hiding mechanism.
>> Please, see a fix description in the first comment.
>> 
>> Testing:
>>  - Verified with new test `vthread/CheckHiddenFrames`
>>  - Mach5 tiers 1-6 are passed
>
> src/hotspot/share/prims/jvmtiEnvBase.cpp line 2009:
> 
>> 2007:   bool is_virtual = java_lang_VirtualThread::is_instance(thread_oop);
>> 2008: 
>> 2009:   // Target can be virtual or platform thread.
> 
> Can you please explain in comment why is it needed to disable all threads for platform target thread.

Thank you for suggestion. Explained comment.
Now, it looks as below:

  // Target can be virtual or platform thread.
  // Disable VTMS transition for one thread if it is virtual.
  // Otherwise, disable VTMS transitions for all threads
  // to protect against VTMS transitions in carrier threads.
  // For the latter VTMS transitions are disabled for all threads by several reasons:
  // - carrier threads can mount virtual threads which may cause incorrect behavior
  // - it is good invariant if we can ensure no VTMS transition might happen at some points 
  // - there is no mechanism to disable transitions for a specific carrier threads yet

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21397#discussion_r1793048247


More information about the core-libs-dev mailing list