JDK-8145148 : InterfaceMethod CP entry pointing to a class should cause ICCE
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-12-10
  • Updated: 2022-04-25
  • Resolved: 2016-05-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b122Fixed
Related Reports
Blocks :  
Blocks :  
Cloners :  
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8174868 :  
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)

Comments
URL: https://github.com/openjdk/jdk/commit/c36295e947397cf70ccc1e976a0f866a94b3ab2b User: coleenp Date: May 27, 2016
25-04-2022

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)
17-06-2016

URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/ea45fb60fbbe User: lana Date: 2016-06-08 20:34:57 +0000
08-06-2016

URL: http://hg.openjdk.java.net/jdk9/hs/hotspot/rev/ea45fb60fbbe User: coleenp Date: 2016-05-27 17:55:12 +0000
27-05-2016

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.
25-01-2016