Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8266330

itableMethodEntry::initialize() asserts with archived old classes

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • P2
    • Resolution: Fixed
    • 17
    • 17
    • hotspot
    • b22
    • Verified

    Description

      The scenario is that a class implements an old interface but the implementation is in another class.
      e.g.
      public class A extends B implements I {
      }

      public interface I
      version 49:0
      {
        public abstract Method doit:"()Ljava/lang/String;";

      } // end Class I

      public class B {
          public String doit() {
              return "doit from B";
          }
      }

      With the above classes in static CDS archive, during initialization of A, the following assert failed in itableMethodEntry::initialize():

          assert(_method == m, "sanity");

      Call stack:
      Stack: [0x00007fb10876a000,0x00007fb10886b000], sp=0x00007fb108869010, free space=1020k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0xd66732] itableMethodEntry::initialize(InstanceKlass*, Method*)+0x15c
      V [libjvm.so+0xd67a46] klassItable::initialize_itable_for_interface(int, InstanceKlass*, GrowableArray<Method*>*, int)+0x396
      V [libjvm.so+0xd66b93] klassItable::initialize_itable(GrowableArray<Method*>*)+0x283
      V [libjvm.so+0xd6711a] klassItable::initialize_itable_and_check_constraints(Thread*)+0x7c
      V [libjvm.so+0xa9a6ea] InstanceKlass::link_class_impl(Thread*)+0x692
      V [libjvm.so+0xa99fa1] InstanceKlass::link_class(Thread*)+0x7f
      V [libjvm.so+0xa9ab71] InstanceKlass::initialize_impl(Thread*)+0x61
      V [libjvm.so+0xa99e92] InstanceKlass::initialize(Thread*)+0x40
      V [libjvm.so+0xabd391] InterpreterRuntime::_new(JavaThread*, ConstantPool*, int)+0xfd
      j MyTest.main([Ljava/lang/String;)V+0
      v ~StubRoutines::call_stub
      V [libjvm.so+0xacb949] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x59d
      V [libjvm.so+0xf84986] os::os_exception_wrapper(void (*)(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*), JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x36
      V [libjvm.so+0xacb3a8] JavaCalls::call(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x8e
      V [libjvm.so+0xb77b00] jni_invoke_static(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, Thread*)+0x188
      V [libjvm.so+0xb85958] jni_CallStaticVoidMethod+0x1e1
      C [libjli.so+0x4de3] JavaMain+0xbf7
      C [libjli.so+0xb025] ThreadJavaMain+0x27

      Attachments

        Issue Links

          Activity

            People

              ccheung Calvin Cheung
              ccheung Calvin Cheung
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: