Withdrawn: 8313816: Accessing jmethodID might lead to spurious crashes
Jaroslav Bachorik
jbachorik at openjdk.org
Tue Nov 14 17:59:41 UTC 2023
On Mon, 7 Aug 2023 00:50:30 GMT, Jaroslav Bachorik <jbachorik at openjdk.org> wrote:
> This is a best effort attempt to harmonize the handling of jmethodIDs when the instanceKlass internal structures are being deallocated (eg. due to `ClassLoaderData::free_deallocate_list`).
> In all other instances, the jmethodID is NULLed (or set to `_free_method`) before the references Method structures are deallocated. This actually makes possible to query such jmethodIDs without crashing JVM even if the corresponding classes/methods were unloaded.
>
> While it is understandable why JVM can not keep the method metadata around forever it really should be possible to at least assert the validity of a jmethodID without crashing JVM. If nothing else, this makes using the JVMTI functions `GetAllStackTraces` or `GetStackTrace` a risk to use in JVMTI agents - the jmethodids can become invalid the very next moment after the stacktrace is obtained.
This pull request has been closed without being integrated.
-------------
PR: https://git.openjdk.org/jdk/pull/15171
More information about the hotspot-dev
mailing list