RFR: 8260009: InstanceKlass::has_as_permitted_subclass() fails if subclass was redefined
David Holmes
david.holmes at oracle.com
Thu Jan 21 22:23:05 UTC 2021
On 22/01/2021 8:19 am, David Holmes wrote:
> On Thu, 21 Jan 2021 13:41:44 GMT, Harold Seigel <hseigel at openjdk.org> wrote:
>
>> Please review this fix for JDK-8260009. The fix removes the "if (k2 == k)" check for a valid permitted subclass because the check does not work if "k" is being redefined. It fails because 'k' is a temporary InstanceKlass created when loading the redefined class.
>>
>> Instead, the code relies on a name check to determine if 'k' is a permitted subclass.
>>
>> The fix was tested with Mach5 tiers 1-2 on Linux, Mac OS, and Windows, tiers 3-5 on Linux x64, and JCK Lang and VM tests.
>>
>> Thanks, Harold
>
> Hi Harold,
>
> This makes me wonder whether we can have a similar issue with nestmate checking?
Thinking more, I think not. IIUC the issue here is that the permitted
subclass check happens as part of redefinition - correct? Whereas there
is no nestmate access check as part of redefinition.
David
> Just curious: is there any way to determine that a Klass k2 is actually a redefinition of Klass k1? I
>
> One nit below, otherwise this seems fine.
>
> Thanks,
> David
>
> src/hotspot/share/oops/instanceKlass.cpp line 255:
>
>> 253: // Do not check for a resolved cp entry, because that check can fail if
>> 254: // the class is being redefined. Just do a name check.
>> 255: // We don't want to resolve any class other than the one being checked.
>
> You don't resolve any classes at all now so this comment can go.
>
> -------------
>
> Marked as reviewed by dholmes (Reviewer).
>
> PR: https://git.openjdk.java.net/jdk/pull/2184
>
More information about the hotspot-dev
mailing list