On Fri, 1 Sep 2023 10:47:25 GMT, Markus Grönlund <mgron...@openjdk.org> wrote:

>> Just to add that  Patricio suggested today to run the stress tests with 
>> -Xint and that does lead to triggering the assert quickly when the thread is 
>> sampled in native. There are several native methods that are 
>> @IntrinsicCandidate that are invoked after the thread identity has changed 
>> to the virtual thread and before the continuation is mounted. Probably less 
>> likely on the unmount as the only native method is the one that reverts the 
>> thread identity.
>
> Ok. If the thread can run native code as part of the mount / unmount, and the 
> sampler can see the intermediary state there too, the check is needed.

Thanks. One other thing that I see when more testing with generational ZGC is 
that ZPageAllocator::alloc_page will record an event and this can happen during 
a mount transition. So I think JfrStackTrace::record also needs to test if the 
current thread is a virtual thread without a continuation mounted.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15492#discussion_r1312910082

Reply via email to