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

Crash when InterfaceMethodref resolves to Object.registerNatives

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • hs25
    • 7u5, 8
    • hotspot
    • b56

        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

              lfoltan Lois Foltan
              dlsmith Dan Smith
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: