RFR: 8268364: jmethod clearing should be done during unloading [v2]
Coleen Phillimore
coleenp at openjdk.java.net
Fri Jul 2 18:07:57 UTC 2021
On Fri, 2 Jul 2021 01:06:01 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Coleen Phillimore has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - ooops fixed typo
>> - Add a comment about is_loader_alive.
>
> Hi Coleen,
>
> So IIUC by clearing during unload, rather than in the destructor, it ensures that a jmethodID seen as valid by `Method::checked_resolve_jmethod_id` can't become invalid (due to a loader no longer being alive and being reclaimed) unless there is a safepoint (and assuming the JVM TI agent or application code, is not keeping the loader alive). So this fixes the situation in `jvmti_GetMethodDeclaringClass` as per the bug report, but in general we would have to be careful in the JVM TI implementation to avoid safepoints after validating the jmethodID. Is that correct?
>
> Thanks,
> David
I'm not sure why the bot didn't put my reply to @dholmes-ora in the PR.
For the record, all of the tier1-7 tests passed on the oracle supported platforms (linux-aarch64, linux-x64, windows-x64, macos-x64, and macos-aarch64 and their debug counterparts).
-------------
PR: https://git.openjdk.java.net/jdk/pull/4643
More information about the hotspot-dev
mailing list