Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8027490 | 8 | Harold Seigel | P3 | Closed | Fixed | b114 |
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
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
- backported by
-
JDK-8027490 Crash when InterfaceMethodref resolves to Object.registerNatives
-
- Closed
-
- relates to
-
JDK-8028626 invokeinterface selects the static Object.registerNatives method
-
- Closed
-
-
JDK-8028741 Interface Method Resolution should skip static and non-public methods in j.l.Object
-
- Closed
-
-
JDK-8021581 Private class methods interfere with invocations of interface methods
-
- Open
-
-
JDK-8024647 Default method resolution with private superclass method
-
- Closed
-