Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8209307 | 12 | Igor Ignatyev | P4 | Resolved | Fixed | b07 |
JDK-8209212 | 11.0.2 | Igor Ignatyev | P4 | Resolved | Fixed | b01 |
JDK-8209287 | 11.0.1 | Igor Ignatyev | P4 | Resolved | Fixed | b05 |
The test consists of a Java source file and a jasm file which are used as follows:
* @compile CallSites.jasm
* @run main/othervm -Xverify:all -Xbatch
* -XX:CompileCommand=dontinline,compiler.linkage.LinkageErrors::test*
* compiler.linkage.LinkageErrors
The Java file defines:
interface I {
void m1(int i);
static void s1() {}
}
class A implements I {
public void m1(int i) {}
}
the jasm file has:
super class compiler/linkage/I
version 52:0
{
}
which defines I as a class not an interface.
When we run the test from clean the @compile causes the jasm to be processed and I.class is generate where I is a class. Then the @run causes LinkageErrors.java to be compiled, which overwrites I.class with a new version when I is an interface again. The test then runs, instantiates class A, and everything passes.
If you then run the test again, jtreg again processes the @compile for the jasm file and so we get I.class where I is a class. For the @run however jtreg sees that LinkageError.class is up to date and so doesn't re-run javac. Now when we instantiate A it claims I as a superinterface but I is class and so the test fails with:
java.lang.IncompatibleClassChangeError: Implementing class
which comes from the classFileParser when loading a class and it finds that a listed superinterface is not in fact an interface.
The definition of I in the jasm file needs to be a proper interface definition, not a class definition.
* @compile CallSites.jasm
* @run main/othervm -Xverify:all -Xbatch
* -XX:CompileCommand=dontinline,compiler.linkage.LinkageErrors::test*
* compiler.linkage.LinkageErrors
The Java file defines:
interface I {
void m1(int i);
static void s1() {}
}
class A implements I {
public void m1(int i) {}
}
the jasm file has:
super class compiler/linkage/I
version 52:0
{
}
which defines I as a class not an interface.
When we run the test from clean the @compile causes the jasm to be processed and I.class is generate where I is a class. Then the @run causes LinkageErrors.java to be compiled, which overwrites I.class with a new version when I is an interface again. The test then runs, instantiates class A, and everything passes.
If you then run the test again, jtreg again processes the @compile for the jasm file and so we get I.class where I is a class. For the @run however jtreg sees that LinkageError.class is up to date and so doesn't re-run javac. Now when we instantiate A it claims I as a superinterface but I is class and so the test fails with:
java.lang.IncompatibleClassChangeError: Implementing class
which comes from the classFileParser when loading a class and it finds that a listed superinterface is not in fact an interface.
The definition of I in the jasm file needs to be a proper interface definition, not a class definition.
- backported by
-
JDK-8209212 [Testbug] compiler/linkage/LinkageErrors.java fails if run twice
-
- Resolved
-
-
JDK-8209287 [Testbug] compiler/linkage/LinkageErrors.java fails if run twice
-
- Resolved
-
-
JDK-8209307 [Testbug] compiler/linkage/LinkageErrors.java fails if run twice
-
- Resolved
-
- relates to
-
JDK-8154172 C1: NPE is thrown instead of linkage error when invoking nonexistent method
-
- Closed
-