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

[ddc, expression_compiler_worker] Null check failure in expression compilation #49373

Closed
annagrin opened this issue Jun 30, 2022 · 0 comments
Closed
Assignees
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. dev-compiler-eval web-dev-compiler

Comments

@annagrin
Copy link
Contributor

annagrin commented Jun 30, 2022

Discovered by dwds tests and happens in Dart SDK version: 2.18.0-238.0.dev (dev) (Wed Jun 29 13:41:53 2022 -0700) on "linux_x64":

Repro

Run VSCode in webdev/fixtures/_webDevSoundSmoke, set a breakpoint on the //Breakpoint ... line and evaluate expression true
You might need to add the following configuration to launch.json:

{
    "name": "Dart web",
    "program": "web",
    "request": "launch",
    "type": "dart"
}

Details from the failing test run in dwds CI

Command

file:///opt/hostedtoolcache/dart-sdk/bin/snapshots/dartdevc.dart.snapshot --experimental-expression-compiler --libraries-file file:///opt/hostedtoolcache/dart-sdk/lib/libraries.json --dart-sdk-summary file:///opt/hostedtoolcache/dart-sdk/lib/_internal/ddc_outline_sound.dill --asset-server-address localhost --asset-server-port 37469 --module-format amd --verbose --sound-null-safety

Dart code being compiled

https://github.com/dart-lang/webdev/tree/master/fixtures/_webdevSoundSmoke

Expression true evaluated at the following breakpoint

https://github.com/dart-lang/webdev/blob/1a70a1aa4ef254d9fea4876635d03f13899e8fc5/fixtures/_webdevSoundSmoke/web/main.dart#L21

Logs
[{"event":"daemon.log","params":{"log":"[FINEST] ExpressionCompilerService: Compiling \"true\" at org-dartlang-app:///web/main.dart:23"}}]
    0:00:01.091215: Compiling expression to JavaScript in module web/main in 353ms.
    0:00:01.107122: Collecting libraries for web/main in 15ms.
    0:00:01.108097: Collected libraries for web/main in 0ms.
    0:00:01.112180: Started building UriTranslator in 4ms.
    0:00:01.121226: Read libraries file in 8ms.
    0:00:01.121476: Read packages file in 0ms.
    0:00:01.122141: Read packages file in 0ms.
    0:00:01.123305: About to initializeFromComponent in 1ms.
    0:00:01.124365: Ran initializeFromComponent in 1ms.
    0:00:01.124947: Appended libraries in 0ms.
    0:00:01.[125](https://github.com/dart-lang/webdev/runs/7137057153?check_suite_focus=true#step:7:168)151: Indexed 34 libraries (0 bytes) in 0.181ms, that is,
           0.000 bytes/ms, and
           0.005 ms/libraries.
    0:00:01.133175: Built outlines for 0 compilation units (0 bytes) in 7.207ms, that is,
           0.000 bytes/ms, and
        Infinity ms/compilation unit.
    0:00:01.149370: Resolved parts in 15ms.
    0:00:01.149410: Applied patches in 0ms.
    0:00:01.150359: Computed library scopes in 0ms.
    0:00:01.150490: Resolved 0 types in 0ms.
    0:00:01.150513: Computed variances of 0 type variables in 0ms.
    0:00:01.150533: Computed default types for 0 type variables in 0ms.
    0:00:01.150562: Checked class hierarchy in 0ms.
    0:00:01.150584: Resolved 0 type-variable bounds in 0ms.
    0:00:01.150603: Built component in 0ms.
    0:00:01.150623: Installed Object as implicit superclass in 0ms.
    0:00:01.150750: Linked component in 0ms.
    0:00:01.155513: Computed core types in 4ms.
    0:00:01.155565: Built class hierarchy in 0ms.
    0:00:01.155597: Checked supertypes in 0ms.
    0:00:01.155615: Installed synthetic constructors in 0ms.
    0:00:01.155627: Resolved 0 constructors in 0ms.
    0:00:01.155644: Built class hierarchy members in 0ms.
    0:00:01.164764: Computed class hierarchy in 9ms.
    0:00:01.164809: Computed show and hide elements in 0ms.
    0:00:01.164858: Performed top level inference in 0ms.
    0:00:01.164872: Checked 0 overrides in 0ms.
    0:00:01.164894: Checked for restricted members inheritance in enums. in 0ms.
    0:00:01.164906: Finished initializing formals in 0ms.
    0:00:01.164917: Computed 0 combined member signatures in 0ms.
    0:00:01.164925: Updated 0 classes in kernel hierarchy in 0ms.
    0:00:01.164938: Added noSuchMethod forwarders in 0ms.
    0:00:01.164951: Checked mixin declaration applications in 0ms.
    0:00:01.164967: Build outline expressions in 0ms.
    0:00:01.164981: Checked type arguments of supers against the bounds in 0ms.
    0:00:01.164994: Checked redirecting factories in 0ms.
    0:00:01.165009: Cloned default values of formals in 0ms.
    0:00:01.165459: Building component in 0ms.
    0:00:01.165521: Built bodies for 0 compilation units (0 bytes) in 0.048ms, that is,
           0.000 bytes/ms, and
        Infinity ms/compilation unit.
    0:00:01.165958: Checked mixin application super-accesses in 0ms.
    0:00:01.165977: Cloned default values of formals in 0ms.
    0:00:01.165987: Finished deferred load tearoffs 0 in 0ms.
    0:00:01.165996: Finished forwarders for 0 procedures in 0ms.
    0:00:01.166010: Finished 0 native methods in 0ms.
    0:00:01.166019: Finished 0 patch methods in 0ms.
    0:00:01.166033: Finished constructors in 0ms.
    0:00:01.166245: Evaluated constants in 0ms.
    0:00:01.166387: Added constant coverage in 0ms.
    0:00:01.173096: Computed delta for expression in 6ms.
    0:00:01.194619: Emitted module for expression in 21ms.
    0:00:01.196427: Compiling expression 
    true in 1ms.
    0:00:01.201581: Compiled expression to JavaScript in 5ms.
    [{"event":"daemon.log","params":{"log":"[FINEST] ExpressionCompilerService: Failed to compile \"true\": Internal error: Null check operator used on a null value:
#0      DartScopeBuilder.visitVariableDeclaration (package:dev_compiler/src/kernel/expression_compiler.dart:172:29)\n
#1      VariableDeclaration.accept (package:kernel/ast.dart:10795:43)\n
#2      Let.visitChildren (package:kernel/ast.dart:8728:14)\n
#3      DartScopeBuilder.defaultTreeNode (package:dev_compiler/src/kernel/expression_compiler.dart:118:10)\n
#4      TreeVisitor.defaultExpression (package:kernel/visitor.dart:196:43)\n
#5      TreeVisitor.visitLet (package:kernel/visitor.dart:319:27)\n
#6      Let.accept (package:kernel/ast.dart:8721:44)\n
#7      visitList (package:kernel/ast.dart:14200:14)\n
#8      Arguments.visitChildren (package:kernel/ast.dart:5346:5)\n
#9      DartScopeBuilder.defaultTreeNode (package:dev_compiler/src/kernel/expression_compiler.dart:118:10)\n
#10     TreeVisitor.visitArguments (package:kernel/visitor.dart:429:39)\n
#11     Arguments.accept (package:kernel/ast.dart:5338:38)\n
#12     InstanceInvocation.visitChildren (package:kernel/ast.dart:5730:15)\n
#13     DartScopeBuilder.defaultTreeNode (package:dev_compiler/src/kernel/expression_compiler.dart:118:10)\n
#14     TreeVisitor.defaultExpression (package:kernel/visitor.dart:196:43)\n
#15     TreeVisitor.visitInstanceInvocation (package:kernel/visitor.dart:241:57)\n
#16     InstanceInvocation.accept (package:kernel/ast.dart:5719:44)\n
#17     ExpressionStatement.visitChildren (package:kernel/ast.dart:9167:16)\n
#18     DartScopeBuilder.defaultTreeNode (package:dev_compiler/src/kernel/expression_compiler.dart:118:10)\n
#19     TreeVisitor.defaultStatement (package:kernel/visitor.dart:339:41)\n
#20     TreeVisitor.visitExpressionStatement (package:kernel/visitor.dart:342:7)\n
#21     ExpressionStatement.accept (package:kernel/ast.dart:9159:43)\n
#22     visitList (package:kernel/ast.dart:14200:14)\n
#23     Block.visitChildren (package:kernel/ast.dart:9222:5)\n
#24     DartScopeBuilder.defaultTreeNode (package:dev_compiler/src/kernel/expression_compiler.dart:118:10)\n
#25     TreeVisitor.defaultStatement (package:kernel/visitor.dart:339:41)\n
#26     TreeVisitor.visitBlock (package:kernel/visitor.dart:344:31)\n
#27     DartScopeBuilder.visitBlock (package:dev_compiler/src/kernel/expression_compiler.dart:181:13)\n
#28     Block.accept (package:kernel/ast.dart:9215:43)\n
#29     FunctionNode.visitChildren (package:kernel/ast.dart:3887:11)\n
#30     DartScopeBuilder.defaultTreeNode (package:dev_compiler/src/kernel/expression_compiler.dart:118:10)\n
#31     TreeVisitor.visitFunctionNode (package:kernel/visitor.dart:428:45)\n
#32     DartScopeBuilder.visitFunctionNode (package:dev_compiler/src/kernel/expression_compiler.dart:160:13)\n
#33     FunctionNode.accept (package:kernel/ast.dart:3874:38)\n
#34     Procedure.visitChildren (package:kernel/ast.dart:3192:14)\n
#35     DartScopeBuilder.defaultTreeNode (package:dev_compiler/src/kernel/expression_compiler.dart:118:10)\n
#36     TreeVisitor.defaultMember (package:kernel/visitor.dart:387:35)\n
#37     DartScopeBuilder.defaultMember (package:dev_compiler/src/kernel/expression_compiler.dart:150:13)\n
#38     TreeVisitor.visitProcedure (package:kernel/visitor.dart:391:39)\n
#39     Procedure.accept (package:kernel/ast.dart:3179:40)\n
#40     visitList (package:kernel/ast.dart:14200:14)\n
#41     Library.visitChildren (package:kernel/ast.dart:574:5)\n
#42     DartScopeBuilder.defaultTreeNode (package:dev_compiler/src/kernel/expression_compiler.dart:118:10)\n
#43     TreeVisitor.visitLibrary (package:kernel/visitor.dart:422:35)\n
#44     DartScopeBuilder.visitLibrary (package:dev_compiler/src/kernel/expression_compiler.dart:132:29)\n
#45     Library.accept (package:kernel/ast.dart:561:38)\n
#46     DartScopeBuilder.findScope (package:dev_compiler/src/kernel/expression_compiler.dart:106:13)\n
#47     ExpressionCompiler._findScopeAt (package:dev_compiler/src/kernel/expression_compiler.dart:404:34)\n
#48     ExpressionCompiler.compileExpressionToJs (package:dev_compiler/src/kernel/expression_compiler.dart:311:23)\n
#49     ExpressionCompilerWorker._compileExpression (package:dev_compiler/src/kernel/expression_compiler_worker.dart:427:54)\n<asynchronous suspension>\n
#50     ExpressionCompilerWorker.run (package:dev_compiler/src/kernel/expression_compiler_worker.dart:274:26)\n<asynchronous suspension>\n
#51     ExpressionCompilerWorker.createAndStart (package:dev_compiler/src/kernel/expression_compiler_worker.dart:[128](https://github.com/dart-lang/webdev/runs/7137057153?check_suite_focus=true#step:7:171):9)\n<asynchronous suspension>\n
#52     internalMain (package:dev_compiler/ddc.dart:36:5)\n<asynchronous suspension>\n"}}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. dev-compiler-eval web-dev-compiler
Projects
None yet
Development

No branches or pull requests

2 participants