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

dart2js crashes in pkg:kernel #56773

Closed
SwederSchellens opened this issue Sep 24, 2024 · 4 comments
Closed

dart2js crashes in pkg:kernel #56773

SwederSchellens opened this issue Sep 24, 2024 · 4 comments
Assignees
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. cfe-crashes Crashes in the CFE front-end-kernel needs-info We need additional information from the issue author (auto-closed after 14 days if no response) type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@SwederSchellens
Copy link

cmd.exe /c rebuild.bat

G:\Imagine\Imaginator>call clean.bat

G:\Imagine\Imaginator>echo Cleaning...
Cleaning...

G:\Imagine\Imaginator>call flutter clean web
Deleting build... 9ms
Deleting .dart_tool... 6ms
Deleting .flutter-plugins-dependencies... 0ms
Deleting .flutter-plugins... 0ms
Cleaning... Done
Building...
Resolving dependencies...
Downloading packages...
collection 1.18.0 (1.19.0 available)
http_parser 4.0.2 (4.1.0 available)
image_picker 0.8.9 (1.1.2 available)
image_picker_for_web 2.2.0 (3.0.5 available)
leak_tracker 10.0.5 (10.0.7 available)
leak_tracker_flutter_testing 3.0.5 (3.0.8 available)
material_color_utilities 0.11.1 (0.12.0 available)
meta 1.15.0 (1.16.0 available)
string_scanner 1.2.0 (1.3.0 available)
test_api 0.7.2 (0.7.3 available)
Got dependencies!
10 packages have newer versions incompatible with dependency constraints.
Try flutter pub outdated for more information.

Compiling lib\main.dart for the Web...
Compiling lib\main.dart for the Web... 12.5s
Target dart2js failed: ProcessException: Process exited abnormally with exit code 253:
.dart_tool/flutter_build/de6c63646dd75acc6a6cb39905a9acb2/main.dart:
Internal Error: The compiler crashed when compiling this element.

The compiler is broken.

When compiling the above element, the compiler crashed. It is not
possible to tell if this is caused by a problem in your program or
not. Regardless, the compiler should not crash.

The Dart team would greatly appreciate if you would take a moment to
report this problem at http://dartbug.com/new.

Please include the following information:

  • the name and version of your operating system, Windows 10, see attachment
    Screenshot 2024-09-24 085152

  • the Dart SDK build number (3.5.1), and

  • the entire message you see here (including the full stack trace
    below as well as the source location above).

The compiler crashed: RangeError (length): Invalid value: Not in inclusive range 0..3: 241
#0 _Array.[] (dart:core-patch/array.dart)
#1 BinaryBuilder._readSimpleInterfaceType (package:kernel/binary/ast_from_binary.dart:3908:27)
#2 BinaryBuilder.readDartType (package:kernel/binary/ast_from_binary.dart:3806:16)
#3 BinaryBuilder.readDartTypeList. (package:kernel/binary/ast_from_binary.dart:3774:55)
#4 new _GrowableList.generate (dart:core-patch/growable_array.dart:136:28)
#5 new List.generate (dart:core-patch/array_patch.dart:46:13)
#6 BinaryBuilder.readDartTypeList (package:kernel/binary/ast_from_binary.dart:3774:16)
#7 BinaryBuilder._readSimpleFunctionType (package:kernel/binary/ast_from_binary.dart:3949:33)
#8 BinaryBuilder.readDartType (package:kernel/binary/ast_from_binary.dart:3810:16)
#9 BinaryBuilder._readInstanceInvocation (package:kernel/binary/ast_from_binary.dart:2528:23)
#10 BinaryBuilder.readExpression (package:kernel/binary/ast_from_binary.dart:2173:16)
#11 BinaryBuilder._readExpressionStatement (package:kernel/binary/ast_from_binary.dart:3528:36)
#12 BinaryBuilder.readStatement (package:kernel/binary/ast_from_binary.dart:3468:16)
#13 BinaryBuilder.readStatementListAlwaysGrowable. (package:kernel/binary/ast_from_binary.dart:3442:56)
#14 new _GrowableList.generate (dart:core-patch/growable_array.dart:136:28)
#15 BinaryBuilder.readStatementListAlwaysGrowable (package:kernel/binary/ast_from_binary.dart:3442:16)
#16 BinaryBuilder._readBlock (package:kernel/binary/ast_from_binary.dart:3721:28)
#17 BinaryBuilder.readStatement (package:kernel/binary/ast_from_binary.dart:3472:16)
#18 BinaryBuilder.readStatementOrNullIfEmpty (package:kernel/binary/ast_from_binary.dart:3447:22)
#19 BinaryBuilder._readIfStatement (package:kernel/binary/ast_from_binary.dart:3637:44)
#20 BinaryBuilder.readStatement (package:kernel/binary/ast_from_binary.dart:3484:16)
#21 BinaryBuilder.readStatementListAlwaysGrowable. (package:kernel/binary/ast_from_binary.dart:3442:56)
#22 new _GrowableList.generate (dart:core-patch/growable_array.dart:136:28)
#23 BinaryBuilder.readStatementListAlwaysGrowable (package:kernel/binary/ast_from_binary.dart:3442:16)
#24 BinaryBuilder._readBlock (package:kernel/binary/ast_from_binary.dart:3721:28)
#25 BinaryBuilder.readStatement (package:kernel/binary/ast_from_binary.dart:3472:16)
#26 BinaryBuilder.readStatementOption (package:kernel/binary/ast_from_binary.dart:3456:38)
#27 BinaryBuilder._setLazyLoadFunction. (package:kernel/binary/ast_from_binary.dart:2088:21)
#28 FunctionNode._buildLazy (package:kernel/ast.dart:3741:23)
#29 FunctionNode.body (package:kernel/ast.dart:3746:5)
#30 FunctionNode.transformChildren (package:kernel/ast.dart:3904:9)
#31 Transformer.defaultTreeNode (package:kernel/visitor.dart:1805:10)
#32 TreeVisitorDefaultMixin.visitFunctionNode (package:kernel/visitor.dart:577:45)
#33 FunctionNode.accept (package:kernel/ast.dart:3872:38)
#34 Transformer.transform (package:kernel/visitor.dart:1771:17)
#35 Procedure.transformChildren (package:kernel/ast.dart:3247:18)
#36 Transformer.defaultTreeNode (package:kernel/visitor.dart:1805:10)
#37 TreeVisitorDefault.defaultMember (package:kernel/visitor.dart:626:35)
#38 MemberVisitorDefaultMixin.visitProcedure (package:kernel/visitor.dart:411:39)
#39 StaticInteropClassEraser.visitProcedure (package:_js_interop_checks/src/transformations/static_interop_class_eraser.dart:179:18)
#40 Procedure.accept (package:kernel/ast.dart:3228:40)
#41 Transformer.transform (package:kernel/visitor.dart:1771:17)
#42 Transformer.transformList (package:kernel/visitor.dart:1788:18)
#43 Class.transformChildren (package:kernel/ast.dart:1525:7)
#44 Transformer.defaultTreeNode (package:kernel/visitor.dart:1805:10)
#45 TreeVisitorDefaultMixin.visitClass (package:kernel/visitor.dart:556:31)
#46 Class.accept (package:kernel/ast.dart:1471:38)
#47 Transformer.transform (package:kernel/visitor.dart:1771:17)
#48 Transformer.transformList (package:kernel/visitor.dart:1788:18)
#49 Library.transformChildren (package:kernel/ast.dart:609:7)
#50 Transformer.defaultTreeNode (package:kernel/visitor.dart:1805:10)
#51 TreeVisitorDefaultMixin.visitLibrary (package:kernel/visitor.dart:565:35)
#52 StaticInteropClassEraser.visitLibrary (package:_js_interop_checks/src/transformations/static_interop_class_eraser.dart:119:18)
#53 Library.accept (package:kernel/ast.dart:585:38)
#54 Transformer.transform (package:kernel/visitor.dart:1771:17)
#55 Transformer.transformList (package:kernel/visitor.dart:1788:18)
#56 Component.transformChildren (package:kernel/ast.dart:14644:7)
#57 Transformer.defaultTreeNode (package:kernel/visitor.dart:1805:10)
#58 TreeVisitorDefaultMixin.visitComponent (package:kernel/visitor.dart:600:39)
#59 _doTransformsOnKernelLoad (package:compiler/src/phase/load_kernel.dart:172:41)
#60 _loadFromSource (package:compiler/src/phase/load_kernel.dart:328:5)

#61 run (package:compiler/src/phase/load_kernel.dart:412:36)

#62 Compiler.loadKernel (package:compiler/src/compiler.dart:392:9)

#63 Compiler.produceKernel (package:compiler/src/compiler.dart:399:36)

#64 Compiler.runSequentialPhases (package:compiler/src/compiler.dart:633:20)

#65 Compiler.runInternal. (package:compiler/src/compiler.dart:316:7)

#66 Compiler.runInternal (package:compiler/src/compiler.dart:315:5)

#67 Compiler.run. (package:compiler/src/compiler.dart:236:11)

#68 compile. (package:compiler/compiler_api.dart:256:30)

#69 compile.compilationDone (package:compiler/src/dart2js.dart:723:3)

#70 main (package:compiler/src/dart2js.dart:1226:3)

Command: G:\flutter_windows_3.24.0-stable\flutter\bin\cache\dart-sdk\bin\dart.exe --disable-dart-dev G:\flutter_windows_3.24.0-stable\flutter\bin\cache\dart-sdk\bin\snapshots\dart2js.dart.snapshot --platform-binaries=G:\flutter_windows_3.24.0-stable\flutter\bin\cache\flutter_web_sdk\kernel --invoker=flutter_tool -Ddart.vm.product=true -DFLUTTER_WEB_AUTO_DETECT=false -DFLUTTER_WEB_USE_SKIA=true -DFLUTTER_WEB_CANVASKIT_URL=https://www.gstatic.com/flutter-canvaskit/c9b9d5780da342eb3f0f5e439a7db06f7d112575/ --native-null-assertions --no-source-maps -o G:\Imagine\Imaginator.dart_tool\flutter_build\de6c63646dd75acc6a6cb39905a9acb2\app.dill --packages=.dart_tool/package_config.json --cfe-only G:\Imagine\Imaginator.dart_tool\flutter_build\de6c63646dd75acc6a6cb39905a9acb2\main.dart
#0 RunResult.throwException (package:flutter_tools/src/base/process.dart:122:5)
#1 _DefaultProcessUtils.run (package:flutter_tools/src/base/process.dart:370:19)

#2 Dart2JSTarget.build (package:flutter_tools/src/build_system/targets/web.dart:203:5)

#3 _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:875:9)

#4 Future.wait. (dart:async/future.dart:534:21)

#5 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:813:32)

#6 Future.wait. (dart:async/future.dart:534:21)

#7 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:813:32)

#8 FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:635:16)

#9 WebBuilder.buildWeb (package:flutter_tools/src/web/compile.dart:92:34)

#10 BuildWebCommand.runCommand (package:flutter_tools/src/commands/build_web.dart:230:5)

#11 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1408:27)

#12 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19)

#13 CommandRunner.runCommand (package:args/command_runner.dart:212:13)

#14 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:420:9)

#15 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19)

#16 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:364:5)

#17 run.. (package:flutter_tools/runner.dart:130:9)

#18 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19)

#19 main (package:flutter_tools/executable.dart:93:3)

Error: Failed to compile application for the Web.
Building... Done

Process finished with exit code 1

@dart-github-bot
Copy link
Collaborator

Summary: The Dart compiler crashed while compiling a Flutter web application, resulting in a RangeError exception. The error occurred during the processing of a function node within the compiled code.

@dart-github-bot dart-github-bot added area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Sep 24, 2024
@lrhn lrhn added area-front-end Use area-front-end for front end / CFE / kernel format related issues. front-end-kernel and removed area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. labels Sep 24, 2024
@johnniwinther johnniwinther added the cfe-crashes Crashes in the CFE label Sep 24, 2024
@jensjoha
Copy link
Contributor

With what it's seemingly trying to do (and - at least if I'm reading it right - this being a just cleaned working directory) my first guess would be file corruption.

What does your G:\flutter_windows_3.24.0-stable\flutter\bin\cache\flutter_web_sdk\kernel directory look like?

Does this happen every time?

@kevmoo kevmoo changed the title The compiler should not crash dart2js crashes in pkg:kernel Sep 24, 2024
@kevmoo kevmoo added the needs-info We need additional information from the issue author (auto-closed after 14 days if no response) label Sep 24, 2024
@SwederSchellens
Copy link
Author

SwederSchellens commented Sep 25, 2024 via email

@julemand101
Copy link
Contributor

Could you close the ticket for me?

If you go to your issue on: #56773

You can close it yourself under the comment input field.

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. cfe-crashes Crashes in the CFE front-end-kernel needs-info We need additional information from the issue author (auto-closed after 14 days if no response) type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

7 participants