JDK-8024804 : Crash when InterfaceMethodref resolves to Object.registerNatives
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 7u5,8
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-09-13
  • Updated: 2014-06-26
  • Resolved: 2013-10-16
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 :  
Description
The following causes a runtime crash.  The class Object declares a 'registerNatives' method, and this is what gets resolved for the call from 'main'.  This condition was not properly accounted for in JVMS 7; the Lambda Spec considers this an IAE (per 5.4.3.4).  (Still, a fix should probably be backported -- this does not depend on new 8 features.)

public class RegisterNatives {
  interface I { void registerNatives(); }
  interface J extends I {}
  static class B implements J { public void registerNatives() { System.out.println("B"); } }
  public static void main(String... args) {
    J val = new B();
    val.registerNatives();
  } 
}

$ -> java8 RegisterNatives
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x000000010ca7ec4c, pid=10885, tid=6403
#
# JRE version: Java(TM) SE Runtime Environment (8.0-b104) (build 1.8.0-ea-b104)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.0-b46 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.dylib+0x387c4c]  LinkResolver::lookup_instance_method_in_klasses(methodHandle&, KlassHandle, Symbol*, Symbol*, Thread*)+0x136
[snip]
Abort trap: 6