RFR: 8339725: Concurrent GC crashed due to GetMethodDeclaringClass [v2]

Andrei Pangin apangin at openjdk.org
Tue Sep 10 21:09:08 UTC 2024


On Tue, 10 Sep 2024 09:07:23 GMT, Liang Mao <lmao at openjdk.org> wrote:

> Okay then that is a programming error not a VM error. It is up to the application to ensure that classes are kept alive if you have jMethodID's for them

@dholmes-ora I'm afraid this is an impossible requirement. The problem has been discussed multiple times previously. E.g., the standard `GetAllStackTraces` API returns an array of raw jmethodIDs, and there is no a guaranteed way for an application to obtain corresponding strong jclass handles before the classes can be unloaded. It's even worse with `AsyncGetCallTrace` function which is typically called inside a signal handler where JVM TI functions are not allowed.

It's OK for JVM TI functions to return an error in the case of class unloading, but a crash does not seem to be a valid JVM behavior.

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

PR Comment: https://git.openjdk.org/jdk/pull/20907#issuecomment-2342011004


More information about the hotspot-dev mailing list