RFR: 8268364: jmethod clearing should be done during unloading [v2]

Daniel D.Daugherty dcubed at openjdk.java.net
Fri Jul 2 18:30:55 UTC 2021


On Fri, 2 Jul 2021 18:03:06 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> 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).

@coleenp - That was me that asked for the Tier[1-7]. Thanks for running that.

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

PR: https://git.openjdk.java.net/jdk/pull/4643


More information about the hotspot-dev mailing list