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

CFE crash in wild #44613

Open
ThinkDigitalSoftware opened this issue Jan 8, 2021 · 6 comments
Open

CFE crash in wild #44613

ThinkDigitalSoftware opened this issue Jan 8, 2021 · 6 comments
Assignees
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues.

Comments

@ThinkDigitalSoftware
Copy link

ThinkDigitalSoftware commented Jan 8, 2021

Don't know how to reproduce.

Unhandled exception:
NoSuchMethodError: The getter 'length' was called on null.
Receiver: null
Tried calling: length
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
#1 setParents (package:kernel/ast.dart:9651:29)
#2 new ForElement (package:front_end/src/fasta/kernel/collections.dart:201:5)
#3 Forest.createForElement (package:front_end/src/fasta/kernel/forest.dart:241:16)
#4 BodyBuilder.endForControlFlow (package:front_end/src/fasta/kernel/body_builder.dart:2796:34)
#5 ForComplete.parse (package:_fe_analyzer_shared/src/parser/literal_entry_info_impl.dart:123:21)
#6 Parser.parseLiteralSetOrMapSuffix (package:_fe_analyzer_shared/src/parser/parser_impl.dart:5246:26)
#7 Parser.parsePrimary (package:_fe_analyzer_shared/src/parser/parser_impl.dart:5011:14)
#8 Parser.parseUnaryExpression (package:_fe_analyzer_shared/src/parser/parser_impl.dart:4870:12)
#9 Parser.parsePrecedenceExpression (package:_fe_analyzer_shared/src/parser/parser_impl.dart:4604:13)
#10 Parser.parseExpression (package:_fe_analyzer_shared/src/parser/parser_impl.dart:4545:13)
#11 BodyBuilder.parseSingleExpression (package:front_end/src/fasta/kernel/body_builder.dart:1376:20)
#12 SourceLoader.buildExpression (package:front_end/src/fasta/source/source_loader.dart:485:21)

#13 IncrementalCompiler.compileExpression. (package:front_end/src/fasta/incremental_compiler.dart:1645:61)
#14 CompilerContext.runInContext.. (package:front_end/src/fasta/compiler_context.dart:123:46)
#15 new Future.sync (dart:async/future.dart:223:31)
#16 CompilerContext.runInContext. (package:front_end/src/fasta/compiler_context.dart:123:19)
#17 _rootRun (dart:async/zone.dart:1190:13)
#18 _CustomZone.run (dart:async/zone.dart:1093:19)
#19 _runZoned (dart:async/zone.dart:1630:10)
#20 runZoned (dart:async/zone.dart:1550:10)
#21 CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:122:12)
#22 IncrementalCompiler.compileExpression (package:front_end/src/fasta/incremental_compiler.dart:1570:26)
#23 IncrementalCompiler.compileExpression (package:vm/incremental_compiler.dart:205:23)
#24 FrontendCompiler.compileExpression (package:frontend_server/frontend_server.dart:925:44)
#25 _FlutterFrontendCompiler.compileExpression (package:flutter_frontend_server/server.dart:74:22)
#26 listenAndCompile. (package:frontend_server/frontend_server.dart:1296:20)
#27 _RootZone.runUnaryGuarded (dart:async/zone.dart:1384:10)
#28 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:357:11)
#29 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:285:7)
#30 _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:69:11)
#31 _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11)
#32 _StringAdapterSink.add (dart:convert/string_conversion.dart:238:11)
#33 _LineSplitterSink._addLines (dart:convert/line_splitter.dart:155:13)
#34 _LineSplitterSink.addSlice (dart:convert/line_splitter.dart:130:5)
#35 StringConversionSinkMixin.add (dart:convert/string_conversion.dart:163:5)
#36 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:121:24)
#37 _RootZone.runUnaryGuarded (dart:async/zone.dart:1384:10)
#38 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:357:11)
#39 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:285:7)
#40 _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:69:11)
#41 _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11)
#42 _StringAdapterSink.add (dart:convert/string_conversion.dart:238:11)
#43 _StringAdapterSink.addSlice (dart:convert/string_conversion.dart:243:7)
#44 _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:317:20)
#45 _Utf8ConversionSink.add (dart:convert/string_conversion.dart:310:5)
#46 _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:72:18)
#47 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:121:24)
#48 _RootZone.runUnaryGuarded (dart:async/zone.dart:1384:10)
#49 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:357:11)
#50 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:285:7)
#51 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:808:19)
#52 _StreamController._add (dart:async/stream_controller.dart:682:7)
#53 _StreamController.add (dart:async/stream_controller.dart:624:5)
#54 _Socket._onData (dart:io-patch/socket_patch.dart:2044:41)
#55 _RootZone.runUnaryGuarded (dart:async/zone.dart:1384:10)
#56 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:357:11)
#57 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:285:7)
#58 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:808:19)
#59 _StreamController._add (dart:async/stream_controller.dart:682:7)
#60 _StreamController.add (dart:async/stream_controller.dart:624:5)
#61 new _RawSocket. (dart:io-patch/socket_patch.dart:1580:33)
#62 _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1076:14)
#63 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#64 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#65 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#66 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)
the Dart compiler exited unexpectedly.
the Dart compiler exited unexpectedly.

Flutter 1.22.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 7891006299 (4 weeks ago) • 2020-12-10 11:54:40 -0800
Engine • revision ae90085a84
Tools • Dart 2.10.4

@vsmenon vsmenon added the area-front-end Use area-front-end for front end / CFE / kernel format related issues. label Jan 8, 2021
@vsmenon vsmenon changed the title NoSuchMethodError: The getter 'length' was called on null. CFE crash in wild Jan 8, 2021
@vsmenon
Copy link
Member

vsmenon commented Jan 8, 2021

@ThinkDigitalSoftware - can you give some context of what you were doing when you saw this error? Building a debug version of the app? Release version? Debugging an app - e.g., typing an expression in the REPL?

What version of Dart and/or Flutter? Android/ios/web?

@ThinkDigitalSoftware
Copy link
Author

ThinkDigitalSoftware commented Jan 8, 2021

Hi, I was paused on a breakpoint In debug mode running on an android device. Let me get the version.

@ThinkDigitalSoftware
Copy link
Author

ThinkDigitalSoftware commented Jan 8, 2021

What version of Dart and/or Flutter? Android/ios/web?

Added the Flutter and Dart version to the description now.

@johnniwinther johnniwinther self-assigned this Jan 20, 2021
@johnniwinther
Copy link
Member

The situation is triggered by code like {for (;;) e;}; (a UI collection for-loop) but I haven't been able to find exactly what to put in the for-loop to trigger the crash.

@ThinkDigitalSoftware
Copy link
Author

And it's an enormous project and I wasn't even working on the UI section of the code... Wish I could help

@johnniwinther
Copy link
Member

From the stack trace the crash happened when evaluating an expression during debugging so the source code isn't even in your project code. The most likely cause is some expression with syntax error being compiled and the crash comes from the recovery we try to make. For instance if you write for (;, we would try to complete it to for (;;); in order to parse it, and this recovery crashes the compiler later in its pipeline.

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.
Projects
None yet
Development

No branches or pull requests

3 participants