[jdk11u-dev] RFR: 8268364: jmethod clearing should be done during unloading [v2]
Aleksey Shipilev
shade at openjdk.org
Tue Oct 29 12:56:26 UTC 2024
On Mon, 30 Sep 2024 16:42:03 GMT, Kerem Kat <duke at openjdk.org> wrote:
>> Backport of [8268364](https://bugs.openjdk.org/browse/JDK-8268364), single hunk conflict resolved by accepting "empty" from the backport commit vs. `clear_jmethod_ids` invocation in the dtor. Backport commit moves the `clear_jmethod_ids` invocation to `unload` method instead.
>>
>> It fixes crashes when accessing jmethodIDs of a class being unloaded.
>>
>> Here is the reproducer that crashes JVM in ~1 second without the patch, but works fine with it: [gist](https://gist.github.com/krk/a0800bac5bc5a01709be85637285a965).
>>
>> This fix also resolves the issue reported at https://github.com/async-profiler/async-profiler/issues/974 for Java 11.
>>
>> To run the repro:
>>
>>
>> javac Main.java
>> gcc -shared -I"$JAVA_HOME/include" -I"$JAVA_HOME/include/linux" -fPIC repro.cpp -orepro.so
>>
>> java -agentpath:"$(pwd)/repro.so" -Xmx100m -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+ExplicitGCInvokesConcurrent Main
>
> Kerem Kat has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
>
> - Merge remote-tracking branch 'upstream/master' into JDK-8268364-jmethodid-fix
> - Backport 3d84398d128bb2eed6280ebbc3f57afb3b89908f
@GoeLin, @jerboaa -- do you see any blockers for approving this?
-------------
PR Comment: https://git.openjdk.org/jdk11u-dev/pull/2935#issuecomment-2444131661
More information about the jdk-updates-dev
mailing list