-
Bug
-
Resolution: Unresolved
-
P4
-
repo-valhalla
When compiling the Graal sources in https://github.com/MichaelHaas99/graal/pull/1 based on https://github.com/MichaelHaas99/valhalla/pull/1, a Graal annotation processor has an unexpected error:
An annotation processor threw an uncaught exception.
Consult the following stack trace for details.
java.lang.InternalError: expected jdk.graal.compiler.core.common.Stride and jdk.graal.compiler.core.common.Stride to be identical
at jdk.graal.compiler.lir.processor.IntrinsicStubProcessor.checkRuntimeCheckedFlagsVariant(IntrinsicStubProcessor.java:248)
at jdk.graal.compiler.lir.processor.IntrinsicStubProcessor.findRuntimeCheckedFlagsVariant(IntrinsicStubProcessor.java:226)
at jdk.graal.compiler.lir.processor.IntrinsicStubProcessor.extractStubs(IntrinsicStubProcessor.java:202)
at jdk.graal.compiler.lir.processor.IntrinsicStubProcessor.doProcess(IntrinsicStubProcessor.java:180)
at jdk.graal.compiler.processor.AbstractProcessor.process(AbstractProcessor.java:80)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:955)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:871)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1199)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1312)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1277)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:953)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:319)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:178)
at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:66)
at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:52)
Further investigation shows that Type.equals [1] returns false because multiple ClassType objects are being created for the same type. Michael has narrowed this down to changes around here: https://github.com/openjdk/valhalla/blame/46e19425017ed4fc0e8e116bbe9ef8617e599b7f/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java#L599
[1] https://github.com/openjdk/valhalla/blob/46e19425017ed4fc0e8e116bbe9ef8617e599b7f/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java#L572
An annotation processor threw an uncaught exception.
Consult the following stack trace for details.
java.lang.InternalError: expected jdk.graal.compiler.core.common.Stride and jdk.graal.compiler.core.common.Stride to be identical
at jdk.graal.compiler.lir.processor.IntrinsicStubProcessor.checkRuntimeCheckedFlagsVariant(IntrinsicStubProcessor.java:248)
at jdk.graal.compiler.lir.processor.IntrinsicStubProcessor.findRuntimeCheckedFlagsVariant(IntrinsicStubProcessor.java:226)
at jdk.graal.compiler.lir.processor.IntrinsicStubProcessor.extractStubs(IntrinsicStubProcessor.java:202)
at jdk.graal.compiler.lir.processor.IntrinsicStubProcessor.doProcess(IntrinsicStubProcessor.java:180)
at jdk.graal.compiler.processor.AbstractProcessor.process(AbstractProcessor.java:80)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:955)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:871)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1199)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1312)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1277)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:953)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:319)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:178)
at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:66)
at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:52)
Further investigation shows that Type.equals [1] returns false because multiple ClassType objects are being created for the same type. Michael has narrowed this down to changes around here: https://github.com/openjdk/valhalla/blame/46e19425017ed4fc0e8e116bbe9ef8617e599b7f/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java#L599
[1] https://github.com/openjdk/valhalla/blob/46e19425017ed4fc0e8e116bbe9ef8617e599b7f/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java#L572