RFR: 8256640: assert(!m->is_old() || ik()->is_being_redefined()) failed: old methods should not be in vtable
Coleen Phillimore
coleenp at openjdk.java.net
Thu Nov 19 15:27:04 UTC 2020
On Thu, 19 Nov 2020 13:08:41 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> Hi all,
>>
>> java/lang/instrument/IsModifiableClassAgent.java fails after JDK-8256365.
>> The reason is that the newly added assert [1] doesn't consider the case when the super class had been redefined.
>>
>> Please review it.
>>
>> Thanks.
>> Best regards,
>> Jie
>>
>> [1] https://github.com/openjdk/jdk/blob/master/src/hotspot/share/oops/klassVtable.cpp#L564
>
> I don't think this is right. We should never put old methods in the table.
This is the patch for this failure but default methods could still get an old method if it's redefined while doing constraint checks. I'd like to take this bug.
$ git diff
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
index 4c720bb..fe7ac9e 100644
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -2577,6 +2577,10 @@ void InstanceKlass::restore_unshareable_info(ClassLoaderData* loader_data, Handl
// point to old or obsolete entries. RedefineClasses doesn't fix up
// vtables in the shared system dictionary, only the main one.
// It also redefines the itable too so fix that too.
+ // First fix any default methods that point to a super class that may
+ // have been redefined.
+ bool trace_name_printed = false;
+ adjust_default_methods(&trace_name_printed);
vtable().initialize_vtable(false, CHECK);
itable().initialize_itable(false, CHECK);
}
-------------
PR: https://git.openjdk.java.net/jdk/pull/1313
More information about the hotspot-runtime-dev
mailing list