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

Compiler crash #27355

Closed
johnpryan opened this issue Sep 14, 2016 · 2 comments
Closed

Compiler crash #27355

johnpryan opened this issue Sep 14, 2016 · 2 comments

Comments

@johnpryan
Copy link
Contributor

johnpryan commented Sep 14, 2016

Details: : running pub run test -p chrome on tests using a package that uses package:js

name and version of operating system: macOS 10 Sierra

Dart SDK build number: 1.19.0

Full stack trace:

Hint: 3 hint(s) suppressed in package:http.
Hint: 5 warning(s) and 1 hint(s) suppressed in package:revolution.
Hint: 1 warning(s) suppressed in package:polymer_elements.
Hint: 2 hint(s) suppressed in package:mockito.
Hint: 33 hint(s) suppressed in package:reflectable.
Hint: 1 hint(s) suppressed in package:fff.
Hint: 2 hint(s) suppressed in package:bignum.
Hint: 1 hint(s) suppressed in package:pointycastle.
Hint: 1 hint(s) suppressed in package:initialize.
Hint: 4 warning(s) suppressed in package:rxdart.
../../../.pub-cache/hosted/pub.dartlang.org/sqllite-1.1.0/lib/src/sqllite_base.dart:25:1:
Internal Error: The compiler crashed when compiling this element.
class QueryResult {
^^^^^
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 (1.19.0), and

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

The compiler crashed: RangeError (index): Invalid value: Valid value range is empty: 0
#0      List.[] (dart:core-patch/growable_array.dart:153)
#1      SsaLoadElimination.visitForeignNew.<anonymous closure> (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/ssa/optimize.dart:2030)
#2      ElementX&AstElementMixin&AnalyzableElementX&ClassElementCommon.forEachInstanceField.fieldFilter (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/elements/common.dart:382)
#3      ElementX&AstElementMixin&AnalyzableElementX&ClassElementCommon.forEachMember.<anonymous closure> (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/elements/common.dart:350)
#4      LinkEntry.forEach (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/util/link_implementation.dart:120)
#5      ClassElementX.forEachLocalMember (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/elements/modelx.dart:2761)
#6      ElementX&AstElementMixin&AnalyzableElementX&ClassElementCommon.forEachMember (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/elements/common.dart:350)
#7      ElementX&AstElementMixin&AnalyzableElementX&ClassElementCommon.forEachInstanceField (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/elements/common.dart:386)
#8      SsaLoadElimination.visitForeignNew (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/ssa/optimize.dart:2027)
#9      HForeignNew.accept (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/ssa/nodes.dart:1888)
#10     SsaLoadElimination.visitBasicBlock (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/ssa/optimize.dart:1999)
#11     SsaLoadElimination.visitGraph (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/ssa/optimize.dart:1958)
#12     SsaOptimizerTask.optimize.runPhase.<anonymous closure> (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/ssa/optimize.dart:46)
#13     CompilerTask.measureSubtask (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/common/tasks.dart:176)
#14     SsaOptimizerTask.optimize.runPhase (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/ssa/optimize.dart:46)
#15     List.forEach (dart:core-patch/growable_array.dart:258)
#16     SsaOptimizerTask.optimize.<anonymous closure> (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/ssa/optimize.dart:91)
#17     CompilerTask.measure (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/common/tasks.dart:63)
#18     SsaOptimizerTask.optimize (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/ssa/optimize.dart:54)
#19     SsaFunctionCompiler.compile (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/ssa/builder.dart:63)
#20     JavaScriptBackend.codegen (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/js_backend/backend.dart:1629)
#21     Compiler.codegen (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/compiler.dart:1074)
#22     CodegenWorkItem.run (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/common/codegen.dart:251)
#23     Compiler.emptyQueue.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure> (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/compiler.dart:946)
#24     CompilerTask.measureSubtask (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/common/tasks.dart:176)
#25     Compiler.emptyQueue.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure> (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/compiler.dart:945)
#26     CompilerTask.measureSubtask (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/common/tasks.dart:176)
#27     Compiler.emptyQueue.<anonymous closure>.<anonymous closure>.<anonymous closure> (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/compiler.dart:942)
#28     CompilerDiagnosticReporter.withCurrentElement (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/compiler.dart:1549)
#29     Compiler.emptyQueue.<anonymous closure>.<anonymous closure> (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/compiler.dart:940)
#30     QueueFilter.processWorkItem (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/enqueue.dart:954)
#31     Enqueuer.forEach (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/enqueue.dart:645)
#32     Compiler.emptyQueue.<anonymous closure> (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/compiler.dart:939)
#33     CompilerTask.measureSubtask (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/common/tasks.dart:176)
#34     Compiler.emptyQueue (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/compiler.dart:938)
#35     Compiler.processQueue.<anonymous closure> (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/compiler.dart:975)
#36     CompilerTask.measureSubtask (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/common/tasks.dart:176)
#37     Compiler.processQueue (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/compiler.dart:952)
#38     Compiler.compileLoadedLibraries.<anonymous closure> (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/compiler.dart:877)
#39     CompilerTask.measureSubtask (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/common/tasks.dart:176)
#40     Compiler.compileLoadedLibraries (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/compiler.dart:771)
#41     Compiler.runInternal.<anonymous closure> (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/compiler/lib/src/compiler.dart:681)
#42     _RootZone.runUnary (dart:async/zone.dart:1404)
#43     _FutureListener.handleValue (dart:async/future_impl.dart:131)
#44     _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:637)
#45     _Future._propagateToListeners (dart:async/future_impl.dart:667)
#46     _Future._completeWithValue (dart:async/future_impl.dart:477)
#47     _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:528)
#48     _microtaskLoop (dart:async/schedule_microtask.dart:41)
#49     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)
#50     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)
#51     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:149)

@johnpryan
Copy link
Contributor Author

johnpryan commented Sep 14, 2016

The tests in question are using custom HTML (e.g. my_test.html including the x-dart-test tag). The tests pass in Dartium, and the app compiles normally with pub build when using the library in question (sqllite-1.1.0)

@rakudrama
Copy link
Member

I was not able to reproduce the crash.

It appears that dart2js is compiling the (factory) constructor for QueryResult.
This might be because of using QueryResult as a type parameter (new isInstanceOf<List>())

Try declaring a constructor for QueryResult, i.e. add this to the class:

external QueryResult();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants