RFR: 8313816: Accessing jmethodID might lead to spurious crashes [v6]

Jaroslav Bachorik jbachorik at openjdk.org
Thu Nov 23 15:22:12 UTC 2023


On Thu, 23 Nov 2023 14:20:48 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Jaroslav Bachorik has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Add exhaustive check for method holder availability (1)
>
> src/hotspot/share/oops/instanceKlass.cpp line 541:
> 
>> 539:       assert (!method->on_stack(), "shouldn't be called with methods on stack");
>> 540:       // Do the pointer maintenance before releasing the metadata
>> 541:       method->clear_jmethod_id();
> 
> IIUC this is O(n^2) over number of methods. Seeing that this is a workaround for a special case (an app that does a lot of retransforms *and* uses async profiler), I'd opt for making it conditional.

Sadly, this is not async-profiler specific. The same issue can be observed by JVMTI only code grabbing a stacktrace.
What do you mean exactly by 'conditional'? Introducing a new JVM flag or something else?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16662#discussion_r1403515842


More information about the hotspot-dev mailing list