[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Re: RFR: 8332259: JvmtiTrace::safe_get_thread_name fails if current thread is in native state [v4]
From:       Leonid Mesnik <lmesnik () openjdk ! org>
Date:       2024-05-20 17:13:01
Message-ID: J03zeOvKDQEfLByYp8coAI_6yi_tsbbef2IVJGJpy1Q=.fa20b8cd-d146-45b6-a34b-4df919eef186 () github ! com
[Download RAW message or body]

On Fri, 17 May 2024 22:31:32 GMT, Leonid Mesnik <lmesnik@openjdk.org> wrote:

> > The JvmtiTrace::safe_get_thread_name sometimes crashes when called while current \
> > thread is in native thread state. 
> > It happens when thread_name is set for tracing from jvmti functions.
> > See:
> > https://github.com/openjdk/jdk/blob/master/src/hotspot/share/prims/jvmtiEnter.xsl#L649 \
> >  
> > The setup is called and the thread name is used in tracing before the thread \
> > transition. There is no good location where this method could be called from vm \
> > thread_state only. Some functions like raw monitor enter/exit never transition in \
> > vm state. So sometimes it is needed to call this function from native thread \
> > state. 
> > The change should affect JVMTI trace mode only (-XX:TraceJVMTI). 
> > 
> > Verified by running jvmti/jdi/jdb tests with tracing enabled.
> 
> Leonid Mesnik has updated the pull request incrementally with one additional commit \
> since the last revision: 
> wrong thread state

There are no tests currently executed with TraceJVMTI.
I am thinking about adding execution of the svc testing. However I've got another \
failure that should resolved before https://bugs.openjdk.org/browse/JDK-8332536
It is not related to the current issue.
Probably, it makes sense to add some basic logging testing with verification of log \
content also.

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

PR Comment: https://git.openjdk.org/jdk/pull/19275#issuecomment-2120856531


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic