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 16:38:11 UTC 2020


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.

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

Commit messages:
 - 8256640: assert(!m->is_old() || ik()->is_being_redefined()) failed: old methods should not be in vtable

Changes: https://git.openjdk.java.net/jdk/pull/1323/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1323&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8256640
  Stats: 24 lines in 2 files changed: 19 ins; 1 del; 4 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1323.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1323/head:pull/1323

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


More information about the hotspot-dev mailing list