RFR: 8365192: post_meth_exit should be in vm state when calling get_jvmti_thread_state [v7]
Leonid Mesnik
lmesnik at openjdk.org
Wed Aug 20 06:46:03 UTC 2025
On Wed, 20 Aug 2025 05:04:38 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision:
>>
>> NULL replaced
>
> test/hotspot/jtreg/serviceability/jvmti/events/MethodExit/ExceptionOccurred.java line 32:
>
>> 30: * @run main/othervm/native -agentlib:ExceptionOccurred ExceptionOccurred
>> 31: */
>> 32: public class ExceptionOccurred {
>
> I'm very confused by the naming here: what exception has occurred where?
The exception was thrown in the current thread/ However, the current method is not unwinded. It is called using JNI while the thread has already thrown but not yet caught exception.
I thought to name it MethodExitWhileExceptionPending, however full name would be
serviceability/jvmti/events/MethodExit/MethodExitWhileExceptionPending/MethodExitWhileExceptionPending.java
so I started to "reduce" it.
Moved to upper directory and removed MethodExit. Also the state looks similar to 'ExceptionOccurred' for JNI method. Let me know if you have better name in the mind.
> test/hotspot/jtreg/serviceability/jvmti/events/MethodExit/ExceptionOccurred/libExceptionOccurred.cpp line 32:
>
>> 30: bool method_exit_posted = false;
>> 31: static void JNICALL
>> 32: cbMethodExit(jvmtiEnv* jvmti, JNIEnv* jni, jthread thread, jmethodID method,
>
> Can you add a comment describing the logic of this callback function please. I cannot make sense of the logic below. How many times will this callback get executed?
Done, hope it makes logic clearer.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26713#discussion_r2287048500
PR Review Comment: https://git.openjdk.org/jdk/pull/26713#discussion_r2287139860
More information about the hotspot-dev
mailing list