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

Internal Error: The compiler crashed when compiling this element. #46123

Closed
afpatmin opened this issue May 25, 2021 · 5 comments
Closed

Internal Error: The compiler crashed when compiling this element. #46123

afpatmin opened this issue May 25, 2021 · 5 comments
Assignees
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@afpatmin
Copy link

Operating system: Ubuntu 20.04.2 LTS
Dart SDK: 2.13.0
Source location: org-dartlang-app:///packages/swedskin/presentation/fullpage/fullpage.dart@2295+1:
Stack trace:
The compiler crashed: Unsupported operation: Unhandled node InvalidExpression(<invalid:Invocation of ParallaxOptions>) (InvalidExpression)
#0 ScopeModelBuilder.defaultNode (package:compiler/src/ir/scope_visitor.dart:123:7)
#1 Visitor.defaultTreeNode (package:kernel/visitor.dart:774:39)
#2 TreeVisitor.defaultExpression (package:kernel/visitor.dart:189:43)
#3 TreeVisitor.visitInvalidExpression (package:kernel/visitor.dart:191:55)
#4 InvalidExpression.accept (package:kernel/ast.dart:3615:44)
#5 ScopeModelBuilder.visitNode (package:compiler/src/ir/scope_visitor.dart:126:18)
#6 ScopeModelBuilder._handleExpression (package:compiler/src/ir/scope_visitor.dart:173:33)
#7 ScopeModelBuilder._handleVariableDeclaration (package:compiler/src/ir/scope_visitor.dart:338:26)
#8 ScopeModelBuilder.visitFunctionNode (package:compiler/src/ir/scope_visitor.dart:827:7)
#9 FunctionNode.accept (package:kernel/ast.dart:3392:38)
#10 ScopeModelBuilder.visitNode (package:compiler/src/ir/scope_visitor.dart:126:18)
#11 ScopeModelBuilder.visitProcedure. (package:compiler/src/ir/scope_visitor.dart:665:7)
#12 ScopeModelBuilder.enterNewScope (package:compiler/src/ir/scope_visitor.dart:277:18)
#13 ScopeModelBuilder.visitInvokable (package:compiler/src/ir/scope_visitor.dart:592:5)
#14 ScopeModelBuilder.visitProcedure (package:compiler/src/ir/scope_visitor.dart:664:5)
#15 Procedure.accept (package:kernel/ast.dart:2741:40)
#16 ScopeModelBuilder.computeModel (package:compiler/src/ir/scope_visitor.dart:113:12)
#17 new ScopeModel.from (package:compiler/src/ir/scope.dart:26:20)
#18 KernelModularStrategy.getModularMemberData. (package:compiler/src/kernel/kernel_strategy.dart:435:38)
#19 CompilerTask.measureSubtask (package:compiler/src/common/tasks.dart:181:35)
#20 KernelModularStrategy.getModularMemberData (package:compiler/src/kernel/kernel_strategy.dart:434:43)
#21 KernelWorkItem.run. (package:compiler/src/kernel/kernel_strategy.dart:384:28)
#22 CompilerTask.measure (package:compiler/src/common/tasks.dart:66:51)
#23 KernelWorkItem.run (package:compiler/src/kernel/kernel_strategy.dart:369:26)
#24 Compiler.emptyQueue..... (package:compiler/src/compiler.dart:530:70)
#25 CompilerTask.measureSubtask (package:compiler/src/common/tasks.dart:181:35)
#26 Compiler.emptyQueue.... (package:compiler/src/compiler.dart:530:32)
#27 CompilerTask.measureSubtask (package:compiler/src/common/tasks.dart:181:35)
#28 Compiler.emptyQueue... (package:compiler/src/compiler.dart:528:28)
#29 CompilerDiagnosticReporter.withCurrentElement (package:compiler/src/compiler.dart:819:15)
#30 Compiler.emptyQueue.. (package:compiler/src/compiler.dart:526:18)
#31 ResolutionEnqueuer._forEach (package:compiler/src/enqueue.dart:450:12)
#32 ResolutionEnqueuer.forEach (package:compiler/src/enqueue.dart:466:5)
#33 Compiler.emptyQueue. (package:compiler/src/compiler.dart:522:16)
#34 CompilerTask.measureSubtask (package:compiler/src/common/tasks.dart:181:35)
#35 Compiler.emptyQueue (package:compiler/src/compiler.dart:521:14)
#36 Compiler.processQueue. (package:compiler/src/compiler.dart:547:7)
#37 CompilerTask.measureSubtask (package:compiler/src/common/tasks.dart:181:35)
#38 Compiler.processQueue (package:compiler/src/compiler.dart:540:14)
#39 Compiler.computeClosedWorld (package:compiler/src/compiler.dart:386:5)
#40 Compiler.compileFromKernel.. (package:compiler/src/compiler.dart:471:17)
#41 CompilerTask.measureSubtask (package:compiler/src/common/tasks.dart:181:35)
#42 Compiler.compileFromKernel. (package:compiler/src/compiler.dart:470:44)
#43 CompilerTask.measureSubtask (package:compiler/src/common/tasks.dart:181:35)
#44 Compiler.compileFromKernel (package:compiler/src/compiler.dart:469:14)
#45 Compiler.runInternal (package:compiler/src/compiler.dart:304:13)

@a-siva
Copy link
Contributor

a-siva commented May 25, 2021

@afpatmin do you have more specific instructions on how this crash can be reproduced?

@a-siva a-siva added area-front-end Use area-front-end for front end / CFE / kernel format related issues. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels May 25, 2021
@johnniwinther
Copy link
Member

The crash is in dart2js upon seen an InvalidExpression. These should only be created when a compile-time error has been emitted, which in turn should prevent dart2js from trying to analyze the code.

Somehow the CFE seem to have emitted an InvalidExpression without the compile-time error. I'll try to see if I can reproduce the crash.

@afpatmin
Copy link
Author

afpatmin commented May 26, 2021

I'm not sure if it's of any help but ParallaxOptions is an interop js object (ie annotated with @JS and @anonymous)

@johnniwinther
Copy link
Member

@afpatmin Thanks, it might be of importance.

@johnniwinther johnniwinther self-assigned this May 26, 2021
@johnniwinther
Copy link
Member

I have a repro. The problem is trying to mark the external factory constructor of an anonymous js-interop class as const:

@JS()
@anonymous
class ParallaxOptions {
  external const factory ParallaxOptions();
}

The constant evaluator fails to report this as a compile-time error - we cannot evaluate an external constructor at compile-time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants