RFR: 8255452: Doing GC during JVMTI MethodExit event posting breaks return oop

Coleen Phillimore coleenp at openjdk.java.net
Fri Oct 30 12:33:58 UTC 2020


On Thu, 29 Oct 2020 22:34:30 GMT, Erik Österlund <eosterlund at openjdk.org> wrote:

>> src/hotspot/share/prims/jvmtiExport.cpp line 1600:
>> 
>>> 1598: 
>>> 1599:   if (exception_exit) {
>>> 1600:     post_method_exit_inner(thread, mh, state, exception_exit, current_frame, result, value);
>> 
>> I think for exception exit, you also need JRT_BLOCK because you want the transition to thread_in_VM for this code, since JRT_BLOCK_ENTRY doesn't do the transition.  It should be safe for exception exit and retain the old behavior.
>
> Thanks for having a look coleen. In fact, not doing the JRT_BLOCK for the exception entry is intentional, because that entry goes through a different JRT_ENTRY (not JRT_BLOCK_ENTRY), that already transitions. So if I do the JRT_BLOCK for the exception path, it asserts saying hey you are already in VM.

Oh that's actually horrible.   I wonder if it's possible to hoist saving the result oop into the InterpreterRuntime entry.  And pass the Handle into JvmtiExport::post_method_exit().

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

PR: https://git.openjdk.java.net/jdk/pull/930


More information about the serviceability-dev mailing list