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

InterfaceMethod CP entry pointing to a class should cause ICCE

    Details

    • Subcomponent:
    • Resolved In Build:
      b122

      Description

      The original fix of 8087223 caused test failures, led two bugs filed: 8143317 and 8143320. The test failures will be addressed in the two bugs. The fix itself has no problem but the test cases failed on it should be changed so the fix should be integrated again.

      The following invoke instructions are successfully executed:
         invokestatic #3; //InterfaceMethod C.foo:()V
         invokestatic #3; //Method I.foo:()V

      where
        class C {...}
        interface I {...}

      JVMS-5.4.3.3 Method Resolution:
       " If C is an interface, method resolution throws an IncompatibleClassChangeError."
      JVMS-5.4.3.4 Interface Method Resolution:
       "If C is not an interface, interface method resolution throws an IncompatibleClassChangeError"

      Test case attached(IntfMethod.java):
      $ java -Xverify:all IntfMethod
      testSpecialIntf: FAILED (no exception)
      testStaticIntf: FAILED (no exception)
      testSpecialClass: FAILED (no exception)
      testStaticClass: FAILED (no exception)
      1. BadInterfaceMethodRef.jasm
        1 kB
        Yumin Qi
      2. BadMethodRef.jasm
        2 kB
        Yumin Qi
      3. IntfMethod.java
        5 kB
        Yumin Qi

        Issue Links

          Activity

          Hide
          minqi Yumin Qi added a comment -
          The fix will be same as 8087223.
          Currently waiting for a fix synced from ASM to jdk. After it is available, 8143320 will be finalized and pushed first, then this fix push follows.
          Show
          minqi Yumin Qi added a comment - The fix will be same as 8087223. Currently waiting for a fix synced from ASM to jdk. After it is available, 8143320 will be finalized and pushed first, then this fix push follows.
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/hs/hotspot/rev/ea45fb60fbbe
          User: coleenp
          Date: 2016-05-27 17:55:12 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/hs/hotspot/rev/ea45fb60fbbe User: coleenp Date: 2016-05-27 17:55:12 +0000
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/ea45fb60fbbe
          User: lana
          Date: 2016-06-08 20:34:57 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/ea45fb60fbbe User: lana Date: 2016-06-08 20:34:57 +0000
          Hide
          coleenp Coleen Phillimore added a comment - - edited
          The JVM has been fixed to check that the constant pool types JVM_CONSTANT_Methodref or JVM_CONSTANT_InterfaceMethodref are consistent with the type of method referenced. These checks are made during method resolution, and are checked for methods that are referenced by JVM_CONSTANT_MethodHandle.

          If consistency checks fail an IncompatibleClassChangeError is thrown.

          javac has never generated inconsistent constant pool entries, but some bytecode generating software may. In many cases, if ASM is embedded in the application, upgrading the the latest version ASM 5.1 resolves the exception. After upgrading ASM, be sure to replace all uses of deprecated functions with calls to the new functions, particularly new functions that pass a boolean whether the method is an interface method: visitMethodInsn and Handle.

          (this is a bit clunky)
          Show
          coleenp Coleen Phillimore added a comment - - edited The JVM has been fixed to check that the constant pool types JVM_CONSTANT_Methodref or JVM_CONSTANT_InterfaceMethodref are consistent with the type of method referenced. These checks are made during method resolution, and are checked for methods that are referenced by JVM_CONSTANT_MethodHandle. If consistency checks fail an IncompatibleClassChangeError is thrown. javac has never generated inconsistent constant pool entries, but some bytecode generating software may. In many cases, if ASM is embedded in the application, upgrading the the latest version ASM 5.1 resolves the exception. After upgrading ASM, be sure to replace all uses of deprecated functions with calls to the new functions, particularly new functions that pass a boolean whether the method is an interface method: visitMethodInsn and Handle. (this is a bit clunky)

            People

            • Assignee:
              coleenp Coleen Phillimore
              Reporter:
              minqi Yumin Qi
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: