RFR: 8339725: Concurrent GC crashed due to GetMethodDeclaringClass [v10]
David Holmes
dholmes at openjdk.org
Wed Sep 11 12:17:14 UTC 2024
On Wed, 11 Sep 2024 10:23:49 GMT, Liang Mao <lmao at openjdk.org> wrote:
>> Hi,
>>
>> It's a fix for 8339725. I think getting the oop from Klass::java_mirror() should use a ON_PHANTOM_OOP_REF decorator here which could make sure the oop would be kept alive in concurrent marking and return nullptr while in concurrent reference processing and unloading.
>>
>> test/hotspot/jtreg/runtime and gc are clean.
>>
>> Thanks,
>> Liang
>
> Liang Mao has updated the pull request incrementally with one additional commit since the last revision:
>
> use -Xmx50m to increace the crash posibility
I guess I am still missing a piece here. We have the initial check for k being alive (which doesn't ensure it stays alive it just allows an early bail out), and we end with creating a JNI reference for the mirror oop. I assume that once we have the JNI reference the mirror oop is again strongly reachable and safe (if not how are we allowed to create the JNI reference for it?). So somewhere inbetween k is no longer alive and the mirror oop is junk. Or is it that things go bad after we create the JNI reference?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20907#issuecomment-2343504474
More information about the hotspot-dev
mailing list