Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Certain compilation errors cause internal error in Andy #170

Open
martinmladenov opened this issue May 25, 2023 · 7 comments
Open

Certain compilation errors cause internal error in Andy #170

martinmladenov opened this issue May 25, 2023 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@martinmladenov
Copy link
Collaborator

martinmladenov commented May 25, 2023

Some compilation errors can cause an internal error in Andy where Andy does not report the problem as a compilation error but as a missing RunConfiguration. For example:

void test(List<@AlphaChars <@StringLength(int value = 5)String> s){

(there is an extra < and there should not be int before value)

@martinmladenov martinmladenov added the bug Something isn't working label May 25, 2023
@martinmladenov
Copy link
Collaborator Author

This causes an exception within the compiler:

An exception has occurred in the compiler (17.0.14). Please file a bug against the Java compiler via the Java bug reporting page (https://bugreport.java.com) after checking the Bug Database (https://bugs.java.com) for duplicates. Include your program, the following diagnostic, and the parameters passed to the Java compiler in your report. Thank you.
java.lang.AssertionError: Unexpected type tree: (ERROR) = 5
	at jdk.compiler/com.sun.tools.javac.tree.TreeInfo.typeIn(TreeInfo.java:1268)
	at jdk.compiler/com.sun.tools.javac.parser.JavacParser.insertAnnotationsToMostInner(JavacParser.java:4666)
	at jdk.compiler/com.sun.tools.javac.parser.JavacParser.parseType(JavacParser.java:814)
	at jdk.compiler/com.sun.tools.javac.parser.JavacParser.typeArgument(JavacParser.java:2146)
	at jdk.compiler/com.sun.tools.javac.parser.JavacParser.typeArguments(JavacParser.java:2111)
	at jdk.compiler/com.sun.tools.javac.parser.JavacParser.typeArguments(JavacParser.java:2180)
	at jdk.compiler/com.sun.tools.javac.parser.JavacParser.typeArgumentsOpt(JavacParser.java:2075)
	at jdk.compiler/com.sun.tools.javac.parser.JavacParser.term3(JavacParser.java:1434)
	at jdk.compiler/com.sun.tools.javac.parser.JavacParser.term2(JavacParser.java:929)
	at jdk.compiler/com.sun.tools.javac.parser.JavacParser.term1(JavacParser.java:900)
	at jdk.compiler/com.sun.tools.javac.parser.JavacParser.term(JavacParser.java:856)
	at jdk.compiler/com.sun.tools.javac.parser.JavacParser.term(JavacParser.java:836)
	at jdk.compiler/com.sun.tools.javac.parser.JavacParser.unannotatedType(JavacParser.java:821)
	at jdk.compiler/com.sun.tools.javac.parser.JavacParser.parseType(JavacParser.java:811)
	at jdk.compiler/com.sun.tools.javac.parser.JavacParser.parseType(JavacParser.java:807)
	at jdk.compiler/com.sun.tools.javac.parser.JavacParser.formalParameter(JavacParser.java:4727)
	at jdk.compiler/com.sun.tools.javac.parser.JavacParser.formalParameters(JavacParser.java:4592)
	at jdk.compiler/com.sun.tools.javac.parser.JavacParser.formalParameters(JavacParser.java:4584)
	at jdk.compiler/com.sun.tools.javac.parser.JavacParser.methodDeclaratorRest(JavacParser.java:4467)
	at jdk.compiler/com.sun.tools.javac.parser.JavacParser.classOrInterfaceOrRecordBodyDeclaration(JavacParser.java:4334)
	at jdk.compiler/com.sun.tools.javac.parser.JavacParser.classInterfaceOrRecordBody(JavacParser.java:4217)
	at jdk.compiler/com.sun.tools.javac.parser.JavacParser.classDeclaration(JavacParser.java:3926)
	at jdk.compiler/com.sun.tools.javac.parser.JavacParser.classOrRecordOrInterfaceOrEnumDeclaration(JavacParser.java:3867)
	at jdk.compiler/com.sun.tools.javac.parser.JavacParser.typeDeclaration(JavacParser.java:3856)
	at jdk.compiler/com.sun.tools.javac.parser.JavacParser.parseCompilationUnit(JavacParser.java:3700)
	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:620)
	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:657)
	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:1006)
	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:993)
	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:919)
	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104)
	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.invocationHelper(JavacTaskImpl.java:152)
	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:100)
	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:94)
	at nl.tudelft.cse1110.andy.execution.step.CompilationStep.execute(CompilationStep.java:66)
	at nl.tudelft.cse1110.andy.execution.ExecutionFlow.run(ExecutionFlow.java:32)
	at nl.tudelft.cse1110.andy.Andy.run(Andy.java:12)
	at nl.tudelft.cse1110.andy.AndyOnWebLab.runAndy(AndyOnWebLab.java:43)
	at nl.tudelft.cse1110.andy.AndyOnWebLab.main(AndyOnWebLab.java:30)

@martinmladenov
Copy link
Collaborator Author

It is very likely a compiler bug. Minimum working example:

B<@C<@D(e f=

It triggers if a processor is added to the compilation task (even if this processor does nothing).

@Arraying
Copy link
Contributor

Arraying commented Mar 2, 2025

Hi, since I'm at Oracle it's probably most streamlined if I take over the bug reporting process. Will comment on this issues with any updates. Feel free to assign the ticket to me.

@martinmladenov
Copy link
Collaborator Author

Thanks!

@Arraying
Copy link
Contributor

Arraying commented Mar 3, 2025

I’ve filed a bug report via the external form, since we’re not sure if I’m allowed to file to JBS directly as a non-author although I have permission to do so.

I expect we’ll get an update in the coming days or weeks.

@Arraying
Copy link
Contributor

Arraying commented Mar 5, 2025

Issue is on JBS: https://bugs.openjdk.org/browse/JDK-8351260

@Arraying
Copy link
Contributor

Someone got assigned to it; seems like the aim is to fix it for 25 (LTS, scheduled for September). If we're lucky we will get backports for older versions of OpenJDK (and thus Coretto benefits from this too), but I wouldn't count on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants