JDK-8016764 : JVM does not prohibit invokespecial in c.f.v 51.0 that invokes default interface method in c.f.v. 52.0
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: hs25,8
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-06-17
  • Updated: 2014-01-14
  • Resolved: 2013-08-29
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 8 Other
8Fixed hs25Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
Please use attached test sources to reproduce such situation.

$ /java/re/jdk/8/promoted/ea/b94/binaries/solaris-sparc/bin/java -jar /java/re/asmtools/5.0/promoted/ea/b02/binaries/asmtools-5.0/lib/asmtools.jar jasm instr_01303m10p.jasm instr_01303m11n.jasm -d .
instr_01303m10p.jasm:13: Warning: interface method must be abstract public only  "   *****public *****".
public Method m:"()V"
              ^
instr_01303m10p.jasm:52: Warning: Wrong tag: Method expected.
                invokespecial       InterfaceMethod m:"()V";
                                                   ^
instr_01303m11n.jasm:13: Warning: interface method must be abstract public only  "   *****public *****".
public Method m:"()V"
              ^
instr_01303m11n.jasm:52: Warning: Wrong tag: Method expected.
                invokespecial       InterfaceMethod m:"()V";
                                                   ^
4 warnings

$ /java/re/jdk/8/promoted/ea/b94/binaries/solaris-sparc/bin/javac -g:none instr_01303m1.java -d .
Note: instr_01303m1.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

$ /java/re/jdk/8/promoted/ea/b94/binaries/solaris-sparc/bin/java -cp . javasoft.sqe.tests.vm.classfmt.ins.instr_013.instr_01303m1.instr_01303m1
Failed to reject invalid class instr_01303m11n

Comments
Some of the JCK tests listed here, such as resolveMethod00602m1 and resolveMethod00602m2, fail because of issues with private concrete methods in interfaces, not because of issues with invokespecial and c.f.v 51.0. See bug JDK-8011311.
28-08-2013

Thank you for the test! Fix in ClassVerifier::verify_invoke_instructions. case Bytecodes::_invokespecial needs to use same case statement as Bytecodes::invokestatic
08-08-2013

Please note that the following tests vm/constantpool/resolveMethod/resolveMethod006/resolveMethod00602m1/resolveMethod00602m1.html vm/constantpool/resolveMethod/resolveMethod006/resolveMethod00602m2/resolveMethod00602m2.html failed due to another issue (JDK-8009130).
24-07-2013

The following test new in JCK8-b26 failed due to this issue: vm/classfmt/ins/instr_013/instr_01303m1/instr_01303m1.html
05-07-2013

Please notice that in similar environment JVM (correctly) rejects invocation of static method in interface with invokestatic opcode in c.f.v 51.0: --- cut --- Passed with loading exception: java.lang.VerifyError: Illegal type at constant pool entry 2 in class javasoft.sqe.tests.vm.classfmt.ins.instr_013.instr_01304m1.instr_01304m11n Exception Details: Location: javasoft/sqe/tests/vm/classfmt/ins/instr_013/instr_01304m1/instr_01304m11n.run([Ljava/lang/String;Ljava/io/PrintStream;)I @0: invokestatic Reason: Constant pool index 2 is invalid Bytecode: 0000000: b800 0203 ac result: Passed. OK --- cut ---
05-07-2013