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

Another dart2js compiler crash #35875

Closed
generic13 opened this issue Feb 6, 2019 · 5 comments
Closed

Another dart2js compiler crash #35875

generic13 opened this issue Feb 6, 2019 · 5 comments
Assignees
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. crash Process exits with SIGSEGV, SIGABRT, etc. An unhandled exception is not a crash.

Comments

@generic13
Copy link

The following code crashes dart2js:

class A {
int a;
A( int a ){ (this).a = a; }
}

I understand that "(this)" might be an illegal dart syntax (I am compiling generated code that produced it) and reporting it to help fix compiler crashes.
Here is the output of the dart2js:

test.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,

  • the Dart SDK build number (2.2.0-dev.0.0), and

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

The compiler crashed: Crash when compiling file:///usr2/jdev/devel.3.8.dart/test_comp/test.dart,
at character offset 21:
test.dart:2:22: Internal problem: Unsupported operation: 'ThisExpression'.
A( int a ){ (this).a = a; }
^
#0 internalProblem (package:front_end/src/fasta/problems.dart:43:3)
#1 unsupported (package:front_end/src/fasta/problems.dart:70:10)
#2 PropertyAccessGenerator.make (package:front_end/src/fasta/kernel/expression_generator.dart:303:14)
#3 Generator.buildPropertyAccess (package:front_end/src/fasta/kernel/expression_generator.dart:213:38)
#4 IncompletePropertyAccessGenerator.withReceiver (file:///b/build/slave/dart-sdk-linux-dev/build/sdk/pkg/front_end/lib/src/fasta/kernel/kernel_expression_generator_impl.dart:361:23)
#5 BodyBuilder.doDotOrCascadeExpression (package:front_end/src/fasta/kernel/body_builder.dart:1336:17)
#6 BodyBuilder.endBinaryExpression (package:front_end/src/fasta/kernel/body_builder.dart:1254:14)
#7 Parser.parsePrecedenceExpression (package:front_end/src/fasta/parser/parser.dart:3756:22)
#8 Parser.parseExpression (package:front_end/src/fasta/parser/parser.dart:3685:13)
#9 Parser.parseExpressionStatement (package:front_end/src/fasta/parser/parser.dart:3650:13)
#10 Parser.parseExpressionStatementOrDeclarationAfterModifiers (package:front_end/src/fasta/parser/parser.dart:5012:16)
#11 Parser.parseExpressionStatementOrDeclaration (package:front_end/src/fasta/parser/parser.dart:4972:12)
#12 Parser.parseStatementX (package:front_end/src/fasta/parser/parser.dart:3554:14)
#13 Parser.parseStatement (package:front_end/src/fasta/parser/parser.dart:3473:20)
#14 Parser.parseFunctionBody (package:front_end/src/fasta/parser/parser.dart:3378:15)
#15 DietListener.buildFunctionBody (package:front_end/src/fasta/source/diet_listener.dart:826:14)
#16 DietListener.endMethod (package:front_end/src/fasta/source/diet_listener.dart:578:5)
#17 Parser.parseMethod (package:front_end/src/fasta/parser/parser.dart:3036:14)
#18 Parser.parseClassOrMixinMemberImpl (package:front_end/src/fasta/parser/parser.dart:2899:15)
#19 Parser.parseClassOrMixinBody (package:front_end/src/fasta/parser/parser.dart:2704:15)
#20 Parser.parseClass (package:front_end/src/fasta/parser/parser.dart:1714:13)
#21 Parser.parseClassOrNamedMixinApplication (package:front_end/src/fasta/parser/parser.dart:1674:14)
#22 Parser.parseTopLevelKeywordDeclaration (package:front_end/src/fasta/parser/parser.dart:569:14)
#23 Parser.parseTopLevelDeclarationImpl (package:front_end/src/fasta/parser/parser.dart:461:14)
#24 Parser.parseUnit (package:front_end/src/fasta/parser/parser.dart:340:15)
#25 SourceLoader.buildBody (package:front_end/src/fasta/source/source_loader.dart:253:14)

#26 Loader.buildBodies (package:front_end/src/fasta/loader.dart:182:15)

#27 KernelTarget.buildComponent. (package:front_end/src/fasta/kernel/kernel_target.dart:307:20)

#28 withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)

#29 KernelTarget.buildComponent (package:front_end/src/fasta/kernel/kernel_target.dart:305:12)

#30 generateKernelInternal. (package:front_end/src/kernel_generator_impl.dart:145:38)

#31 withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)

#32 generateKernelInternal (package:front_end/src/kernel_generator_impl.dart:55:10)

#33 compile. (package:front_end/src/api_unstable/dart2js.dart:140:32)

#34 CompilerContext.runWithOptions. (package:front_end/src/fasta/compiler_context.dart:132:20)

#35 CompilerContext.runInContext.. (package:front_end/src/fasta/compiler_context.dart:120:46)
#36 new Future.sync (dart:async/future.dart:224:31)
#37 CompilerContext.runInContext. (package:front_end/src/fasta/compiler_context.dart:120:19)
#38 _rootRun (dart:async/zone.dart:1124:13)
#39 _CustomZone.run (dart:async/zone.dart:1021:19)
#40 _runZoned (dart:async/zone.dart:1516:10)
#41 runZoned (dart:async/zone.dart:1463:12)
#42 CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:119:12)
#43 CompilerContext.runWithOptions (package:front_end/src/fasta/compiler_context.dart:130:10)
#44 compile (package:front_end/src/api_unstable/dart2js.dart:138:46)

#45 LibraryLoaderTask.loadLibraries. (file:///b/build/slave/dart-sdk-linux-dev/build/sdk/pkg/compiler/lib/src/library_loader.dart:74:27)

#46 CompilerTask.measure (file:///b/build/slave/dart-sdk-linux-dev/build/sdk/pkg/compiler/lib/src/common/tasks.dart:63:51)
#47 LibraryLoaderTask.loadLibraries (file:///b/build/slave/dart-sdk-linux-dev/build/sdk/pkg/compiler/lib/src/library_loader.dart:56:12)
#48 Compiler.runInternal (file:///b/build/slave/dart-sdk-linux-dev/build/sdk/pkg/compiler/lib/src/compiler.dart:277:61)

#49 Compiler.run.. (file:///b/build/slave/dart-sdk-linux-dev/build/sdk/pkg/compiler/lib/src/compiler.dart:220:38)
#50 new Future.sync (dart:async/future.dart:224:31)
#51 Compiler.run. (file:///b/build/slave/dart-sdk-linux-dev/build/sdk/pkg/compiler/lib/src/compiler.dart:220:20)
#52 CompilerTask.measureSubtask (file:///b/build/slave/dart-sdk-linux-dev/build/sdk/pkg/compiler/lib/src/common/tasks.dart:178:35)
#53 Compiler.run (file:///b/build/slave/dart-sdk-linux-dev/build/sdk/pkg/compiler/lib/src/compiler.dart:217:41)
#54 CompilerImpl.run.. (file:///b/build/slave/dart-sdk-linux-dev/build/sdk/pkg/compiler/lib/src/apiimpl.dart:89:22)
#55 _RootZone.runUnary (dart:async/zone.dart:1379:54)
#56 _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
#57 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
#58 Future._propagateToListeners (dart:async/future_impl.dart:668:32)
#59 Future._completeWithValue (dart:async/future_impl.dart:483:5)
#60 Future._asyncComplete. (dart:async/future_impl.dart:513:7)
#61 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#62 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#63 _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13)
#64 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)

#0 DietListener.buildFunctionBody (package:front_end/src/fasta/source/diet_listener.dart:834:7)
#1 DietListener.endMethod (package:front_end/src/fasta/source/diet_listener.dart:578:5)
#2 Parser.parseMethod (package:front_end/src/fasta/parser/parser.dart:3036:14)
#3 Parser.parseClassOrMixinMemberImpl (package:front_end/src/fasta/parser/parser.dart:2899:15)
#4 Parser.parseClassOrMixinBody (package:front_end/src/fasta/parser/parser.dart:2704:15)
#5 Parser.parseClass (package:front_end/src/fasta/parser/parser.dart:1714:13)
#6 Parser.parseClassOrNamedMixinApplication (package:front_end/src/fasta/parser/parser.dart:1674:14)
#7 Parser.parseTopLevelKeywordDeclaration (package:front_end/src/fasta/parser/parser.dart:569:14)
#8 Parser.parseTopLevelDeclarationImpl (package:front_end/src/fasta/parser/parser.dart:461:14)
#9 Parser.parseUnit (package:front_end/src/fasta/parser/parser.dart:340:15)
#10 SourceLoader.buildBody (package:front_end/src/fasta/source/source_loader.dart:253:14)

#11 Loader.buildBodies (package:front_end/src/fasta/loader.dart:182:15)

#12 KernelTarget.buildComponent. (package:front_end/src/fasta/kernel/kernel_target.dart:307:20)

#13 withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)

#14 KernelTarget.buildComponent (package:front_end/src/fasta/kernel/kernel_target.dart:305:12)

#15 generateKernelInternal. (package:front_end/src/kernel_generator_impl.dart:145:38)

#16 withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)

#17 generateKernelInternal (package:front_end/src/kernel_generator_impl.dart:55:10)

#18 compile. (package:front_end/src/api_unstable/dart2js.dart:140:32)

#19 CompilerContext.runWithOptions. (package:front_end/src/fasta/compiler_context.dart:132:20)

#20 CompilerContext.runInContext.. (package:front_end/src/fasta/compiler_context.dart:120:46)
#21 new Future.sync (dart:async/future.dart:224:31)
#22 CompilerContext.runInContext. (package:front_end/src/fasta/compiler_context.dart:120:19)
#23 _rootRun (dart:async/zone.dart:1124:13)
#24 _CustomZone.run (dart:async/zone.dart:1021:19)
#25 _runZoned (dart:async/zone.dart:1516:10)
#26 runZoned (dart:async/zone.dart:1463:12)
#27 CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:119:12)
#28 CompilerContext.runWithOptions (package:front_end/src/fasta/compiler_context.dart:130:10)
#29 compile (package:front_end/src/api_unstable/dart2js.dart:138:46)

#30 LibraryLoaderTask.loadLibraries. (file:///b/build/slave/dart-sdk-linux-dev/build/sdk/pkg/compiler/lib/src/library_loader.dart:74:27)

#31 CompilerTask.measure (file:///b/build/slave/dart-sdk-linux-dev/build/sdk/pkg/compiler/lib/src/common/tasks.dart:63:51)
#32 LibraryLoaderTask.loadLibraries (file:///b/build/slave/dart-sdk-linux-dev/build/sdk/pkg/compiler/lib/src/library_loader.dart:56:12)
#33 Compiler.runInternal (file:///b/build/slave/dart-sdk-linux-dev/build/sdk/pkg/compiler/lib/src/compiler.dart:277:61)

#34 Compiler.run.. (file:///b/build/slave/dart-sdk-linux-dev/build/sdk/pkg/compiler/lib/src/compiler.dart:220:38)
#35 new Future.sync (dart:async/future.dart:224:31)
#36 Compiler.run. (file:///b/build/slave/dart-sdk-linux-dev/build/sdk/pkg/compiler/lib/src/compiler.dart:220:20)
#37 CompilerTask.measureSubtask (file:///b/build/slave/dart-sdk-linux-dev/build/sdk/pkg/compiler/lib/src/common/tasks.dart:178:35)
#38 Compiler.run (file:///b/build/slave/dart-sdk-linux-dev/build/sdk/pkg/compiler/lib/src/compiler.dart:217:41)
#39 CompilerImpl.run.. (file:///b/build/slave/dart-sdk-linux-dev/build/sdk/pkg/compiler/lib/src/apiimpl.dart:89:22)
#40 _RootZone.runUnary (dart:async/zone.dart:1379:54)
#41 _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
#42 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
#43 Future._propagateToListeners (dart:async/future_impl.dart:668:32)
#44 Future._completeWithValue (dart:async/future_impl.dart:483:5)
#45 Future._asyncComplete. (dart:async/future_impl.dart:513:7)
#46 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#47 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#48 _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13)
#49 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)

@peter-ahe-google
Copy link
Contributor

Thanks for the bug report, @generic13 . I think this is legal syntax. Regardless, the compiler shouldn't crash.

@peter-ahe-google peter-ahe-google self-assigned this Feb 7, 2019
@peter-ahe-google peter-ahe-google added area-front-end Use area-front-end for front end / CFE / kernel format related issues. crash Process exits with SIGSEGV, SIGABRT, etc. An unhandled exception is not a crash. labels Feb 7, 2019
@generic13
Copy link
Author

If it's a legal syntax, it would be great (would make it easier to use code generation). Thank you!

@generic13
Copy link
Author

Just checking if it was fixed. I downloaded the latest dev build (dart_2.1.1-dev.3.2-1_amd64.deb) and it still crashes after the following message:

Message.dart:306:14: Internal problem: Unsupported operation: 'ThisExpression'.
(this).op = op;

It would be great if the fix is made available in the dev download.
Thank you!

@peter-ahe-google
Copy link
Contributor

As far as I know, dart_2.1.1-dev.3.2 was cut before my fix landed. But it looks like my fix will be included in the next dev release.

@generic13
Copy link
Author

generic13 commented Feb 18, 2019 via email

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. crash Process exits with SIGSEGV, SIGABRT, etc. An unhandled exception is not a crash.
Projects
None yet
Development

No branches or pull requests

2 participants