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

Liang Mao lmao at openjdk.org
Wed Sep 11 03:45:05 UTC 2024


On Wed, 11 Sep 2024 02:15:51 GMT, David Holmes <dholmes at openjdk.org> wrote:

> So what exactly is the robustness fix being proposed here? The jMethodID is not a means to keep alive a class, and so we have an invalid one. Are we just trying to avoid a crash (in which case how are we reporting that the jMethodID is in fact invalid)? or are we actually making the jMethodID keep the class alive, contrary to the JNI Specification?

I guess it is a defect of VM. Before the GC is done and class is unloaded, the klass is still "alive" and the jvmti API already did correct thing. GC needs to implicitly keep it alive in the middle of concurrent marking just like java threads access a weak reference.

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

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


More information about the hotspot-dev mailing list