RFR: 8256640: assert(!m->is_old() || ik()->is_being_redefined()) failed: old methods should not be in vtable
Daniel D.Daugherty
dcubed at openjdk.java.net
Thu Nov 19 20:53:02 UTC 2020
On Thu, 19 Nov 2020 16:31:44 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
> I added an assert with https://bugs.openjdk.java.net/browse/JDK-8256365 to catch adding redefined methods into the vtable where they don't belong (except while redefining that class). The assert found that CDS was restoring classes with methods in the default_methods array which can be from a redefined class. So these methods need to be adjusted before recreating the vtable.
> Also fixed is a potential bug where a Method in a methodHandle in the default_methods array can be redefined in the safepoint caused by loader constraint checking, then added to the vtable. The window for this bug is very small so I couldn't write a test for it. This change was in my v1 patch for JDK-8256365, so reintroduced here.
>
> The test java/lang/instrument/IsModifiableClassAgent.java now passes with this patch. Rerunning tier1-6 tests in progress. Built with minimal VM to verify #if INCLUDE_JVMTIs were in the right places.
Marked as reviewed by dcubed (Reviewer).
src/hotspot/share/oops/klassVtable.cpp line 237:
> 235: // needs new entry
> 236: if (needs_new_entry) {
> 237: // Refetch this default method in case of redefinition in safepoint above.
Which code above can go to a safepoint? So perhaps reword the comment:
// Refetch this default method in case of redefinition in a safepoint that
// might happen in XXX above.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1323
More information about the hotspot-dev
mailing list