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 compiler crash #35871

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

dart2js compiler crash #35871

generic13 opened this issue Feb 6, 2019 · 9 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

Dart VM version: 2.2.0-dev.0.0 (Mon Nov 19 15:10:42 2018 +0100) on "linux_ia32"
OS/Kernel: Linux 3.2.0-4-686-pae #1 SMP Debian 3.2.73-2+deb7u3 i686

Command and output:
dart2js --allow-mock-compilation GlgDartLib.dart
GlgDartLib.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/dart/GlgAWT.dart,
at character offset null:
RangeError (offset): Invalid value: Not in range 0..4359, inclusive: 14527
#0 RangeError.checkValueInInterval (dart:core/errors.dart:280:7)
#1 Source.getLocation (package:kernel/ast.dart:5722:16)
#2 getLocation (package:front_end/src/fasta/messages.dart:16:52)
#3 ProcessedOptions.format (package:front_end/src/base/processed_options.dart:188:47)
#4 ProcessedOptions.report (package:front_end/src/base/processed_options.dart:212:43)
#5 CompilerContext.report (package:front_end/src/fasta/compiler_context.dart:66:13)
#6 Loader.addMessage (package:front_end/src/fasta/loader.dart:273:20)
#7 Loader.addProblem (package:front_end/src/fasta/loader.dart:229:5)
#8 LibraryBuilder.addProblem (package:front_end/src/fasta/builder/library_builder.dart:96:12)
#9 SourceLibraryBuilder.addBuilder (package:front_end/src/fasta/source/source_library_builder.dart:554:7)
#10 SourceLibraryBuilder.includePart. (package:front_end/src/fasta/source/source_library_builder.dart:730:7)
#11 LibraryBuilder.forEach. (package:front_end/src/fasta/builder/library_builder.dart:204:10)
#12 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.forEach (dart:collection/runtime/libcompact_hash.dart:367:8)
#13 Scope.forEach (package:front_end/src/fasta/scope.dart:251:11)
#14 LibraryBuilder.forEach (package:front_end/src/fasta/builder/library_builder.dart:202:11)
#15 SourceLibraryBuilder.includePart (package:front_end/src/fasta/source/source_library_builder.dart:723:10)
#16 KernelLibraryBuilder.includePart (package:front_end/src/fasta/kernel/kernel_library_builder.dart:1263:11)
#17 SourceLibraryBuilder.includeParts (package:front_end/src/fasta/source/source_library_builder.dart:673:11)
#18 SourceLoader.resolveParts (package:front_end/src/fasta/source/source_loader.dart:321:15)
#19 KernelTarget.buildOutlines. (package:front_end/src/fasta/kernel/kernel_target.dart:265:14)

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

#21 KernelTarget.buildOutlines (package:front_end/src/fasta/kernel/kernel_target.dart:260:12)

#22 generateKernelInternal. (package:front_end/src/kernel_generator_impl.dart:107:28)

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

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

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

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

#27 CompilerContext.runInContext.. (package:front_end/src/fasta/compiler_context.dart:120:46)
#28 new Future.sync (dart:async/future.dart:224:31)
#29 CompilerContext.runInContext. (package:front_end/src/fasta/compiler_context.dart:120:19)
#30 _rootRun (dart:async/zone.dart:1124:13)
#31 _CustomZone.run (dart:async/zone.dart:1021:19)
#32 _runZoned (dart:async/zone.dart:1516:10)
#33 runZoned (dart:async/zone.dart:1463:12)
#34 CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:119:12)
#35 CompilerContext.runWithOptions (package:front_end/src/fasta/compiler_context.dart:130:10)
#36 compile (package:front_end/src/api_unstable/dart2js.dart:138:46)

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

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

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

#0 RangeError.checkValueInInterval (dart:core/errors.dart:280:7)
#1 Source.getLocation (package:kernel/ast.dart:5722:16)
#2 getLocation (package:front_end/src/fasta/messages.dart:16:52)
#3 ProcessedOptions.format (package:front_end/src/base/processed_options.dart:188:47)
#4 ProcessedOptions.report (package:front_end/src/base/processed_options.dart:212:43)
#5 CompilerContext.report (package:front_end/src/fasta/compiler_context.dart:66:13)
#6 Loader.addMessage (package:front_end/src/fasta/loader.dart:273:20)
#7 Loader.addProblem (package:front_end/src/fasta/loader.dart:229:5)
#8 LibraryBuilder.addProblem (package:front_end/src/fasta/builder/library_builder.dart:96:12)
#9 SourceLibraryBuilder.addBuilder (package:front_end/src/fasta/source/source_library_builder.dart:554:7)
#10 SourceLibraryBuilder.includePart. (package:front_end/src/fasta/source/source_library_builder.dart:730:7)
#11 LibraryBuilder.forEach. (package:front_end/src/fasta/builder/library_builder.dart:204:10)
#12 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.forEach (dart:collection/runtime/libcompact_hash.dart:367:8)
#13 Scope.forEach (package:front_end/src/fasta/scope.dart:251:11)
#14 LibraryBuilder.forEach (package:front_end/src/fasta/builder/library_builder.dart:202:11)
#15 SourceLibraryBuilder.includePart (package:front_end/src/fasta/source/source_library_builder.dart:723:10)
#16 KernelLibraryBuilder.includePart (package:front_end/src/fasta/kernel/kernel_library_builder.dart:1263:11)
#17 SourceLibraryBuilder.includeParts (package:front_end/src/fasta/source/source_library_builder.dart:673:11)
#18 SourceLoader.resolveParts (package:front_end/src/fasta/source/source_loader.dart:321:15)
#19 KernelTarget.buildOutlines. (package:front_end/src/fasta/kernel/kernel_target.dart:265:14)

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

#21 KernelTarget.buildOutlines (package:front_end/src/fasta/kernel/kernel_target.dart:260:12)

#22 generateKernelInternal. (package:front_end/src/kernel_generator_impl.dart:107:28)

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

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

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

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

#27 CompilerContext.runInContext.. (package:front_end/src/fasta/compiler_context.dart:120:46)
#28 new Future.sync (dart:async/future.dart:224:31)
#29 CompilerContext.runInContext. (package:front_end/src/fasta/compiler_context.dart:120:19)
#30 _rootRun (dart:async/zone.dart:1124:13)
#31 _CustomZone.run (dart:async/zone.dart:1021:19)
#32 _runZoned (dart:async/zone.dart:1516:10)
#33 runZoned (dart:async/zone.dart:1463:12)
#34 CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:119:12)
#35 CompilerContext.runWithOptions (package:front_end/src/fasta/compiler_context.dart:130:10)
#36 compile (package:front_end/src/api_unstable/dart2js.dart:138:46)

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

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

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

@sigmundch sigmundch 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 6, 2019
@sigmundch
Copy link
Member

This appears to be a crash from the CFE.

@generic13 - to help us investigate, could you provide us with a small example program that would let us reproduce the issue locally?

@generic13
Copy link
Author

generic13 commented Feb 6, 2019 via email

@generic13
Copy link
Author

generic13 commented Feb 6, 2019 via email

@sigmundch
Copy link
Member

Thanks for the great repro @generic13 !

@peter-ahe-google or @askeksa-google - looks like a case where a compile-time error was not properly propagated within fasta?

@peter-ahe-google peter-ahe-google self-assigned this Feb 7, 2019
@peter-ahe-google
Copy link
Contributor

I'm not able to reproduce this crash on top-of-tree. I did fix some issues in this recently, and I notice that @generic13's SDK is a few months old. I'll see if I can reproduce this with an older SDK. @generic13 did you download the SDK from dartlang.org?

@peter-ahe-google
Copy link
Contributor

I'm not sure what is going on here. I was able to find version 2.2.0-dev.0.0 on Archive | Dart.

However, this is not the most recent version of the Dart SDK. That version is 2.1.1-dev.3.2. I think 2.2.0-dev.0.0 might be a mistake in the release process.

@generic13 I recommend that you install a newer version of the SDK.

I can reproduce the second stack trace 2.2.0-dev.0.0, but the error is reported correctly in 2.1.1-dev.3.2:

test2.dart:1:23: Error: 'A' is already declared in this scope.
part of my_lib; class A{}
                      ^
test.dart:1:23: Context: Previous declaration of 'A'.
part of my_lib; class A{}
                      ^

I can reproduce the first stack trace if I add a lot of comments to test2.dart before the declaration of A in 2.2.0-dev.0.0, but again, the error is reported correctly in 2.1.1-dev.3.2:

test2.dart:195:7: Error: 'A' is already declared in this scope.
class A {}
      ^
test.dart:3:7: Context: Previous declaration of 'A'.
class A {}
      ^

@generic13
Copy link
Author

Sorry for a delayed response, emails got caught in spam. Yes, there were a lot of comments, since it's a generated code. With a small test case, the compiler emitted a message before crashing, but with lots of comments, the compiler crashed with no message that would indicate the cause of crash.

I did download from dartlang.org, I'll try again with the newer build.

@generic13
Copy link
Author

The newest version generates a correct error message and does not crash for either the short or large test case.
Thank you!

@peter-ahe-google
Copy link
Contributor

Thank you for letting us know!

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

3 participants