Skip to content

dart2js crash #24778

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

Closed
a14n opened this issue Oct 30, 2015 · 3 comments
Closed

dart2js crash #24778

a14n opened this issue Oct 30, 2015 · 3 comments
Assignees
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures web-dart2js web-js-interop Issues that impact all js interop

Comments

@a14n
Copy link
Contributor

a14n commented Oct 30, 2015

With the following dart file on 1.13.0-dev.7.4 dart2js crashes.

import 'package:js/js.dart';

@JS()
class A {
  external A();
  external int aa();
}

main() {
  print(new A().aa());
}

with the error:

[Dart2JS on new_js_interop|web/index.dart]:
web/packages/$sdk/lib/html/dart2js/html_dart2js.dart:28425:16:
Resolution work list is closed. Trying to add deferred action for field(SpeechRecognitionError#error)
  final String error;
               ^^^^^
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 (build number could not be determined), and

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

Build error:
Transform Dart2JS on new_js_interop|web/index.dart threw error: Assertion failure: Resolution work list is closed. Trying to add deferred action for field(SpeechRecognitionError#error)
package:compiler_unsupported/src/enqueue.dart 931                      ResolutionEnqueuer.addDeferredAction
package:compiler_unsupported/src/resolution/resolution_common.dart 44  CommonResolverVisitor.addDeferredAction
package:compiler_unsupported/src/resolution/members.dart 3950          ResolverVisitor.analyzeConstantDeferred
package:compiler_unsupported/src/resolution/members.dart 3881          ResolverVisitor.visitNewExpression
package:compiler_unsupported/src/tree/nodes.dart 531                   NewExpression.accept
package:compiler_unsupported/src/resolution/resolution.dart 1036       ResolverTask.resolveMetadataAnnotation.<fn>.<fn>
package:compiler_unsupported/src/common/tasks.dart 55                  CompilerTask.measure
package:compiler_unsupported/src/resolution/resolution.dart 1019       ResolverTask.resolveMetadataAnnotation.<fn>
package:compiler_unsupported/src/compiler.dart 1689                    _CompilerDiagnosticReporter.withCurrentElement
package:compiler_unsupported/src/resolution/resolution.dart 1019       ResolverTask.resolveMetadataAnnotation
package:compiler_unsupported/src/compiler.dart 1962                    _CompilerResolution.resolveMetadataAnnotation
package:compiler_unsupported/src/elements/modelx.dart 3114             MetadataAnnotationX.ensureResolved
package:compiler_unsupported/src/native/enqueue.dart 289               NativeEnqueuerBase.findJsNameFromAnnotation
package:compiler_unsupported/src/native/enqueue.dart 391               NativeEnqueuerBase.setNativeName
package:compiler_unsupported/src/native/enqueue.dart 373               NativeEnqueuerBase.handleFieldAnnotations
package:compiler_unsupported/src/enqueue.dart 272                      Enqueuer.processInstantiatedClassMember
package:compiler_unsupported/src/elements/common.dart 323              ElementX&AstElementMixin&AnalyzableElementX&ClassElementCommon.forEachMember.<fn>
package:compiler_unsupported/src/util/link_implementation.dart 120     LinkEntry.forEach
package:compiler_unsupported/src/elements/modelx.dart 2751             ClassElementX.forEachLocalMember
package:compiler_unsupported/src/elements/common.dart 323              ElementX&AstElementMixin&AnalyzableElementX&ClassElementCommon.forEachMember
package:compiler_unsupported/src/enqueue.dart 382                      Enqueuer.processInstantiatedClass.<fn>.processClass
package:compiler_unsupported/src/enqueue.dart 394                      Enqueuer.processInstantiatedClass.<fn>
package:compiler_unsupported/src/common/tasks.dart 55                  CompilerTask.measure
package:compiler_unsupported/src/enqueue.dart 361                      Enqueuer.processInstantiatedClass
package:compiler_unsupported/src/enqueue.dart 244                      Enqueuer.registerInstantiatedType.<fn>
package:compiler_unsupported/src/common/tasks.dart 55                  CompilerTask.measure
package:compiler_unsupported/src/enqueue.dart 234                      Enqueuer.registerInstantiatedType
package:compiler_unsupported/src/common/backend_api.dart 174           Backend.registerInstantiatedType
package:compiler_unsupported/src/js_backend/backend.dart 1203          JavaScriptBackend.registerInstantiatedType
package:compiler_unsupported/src/native/enqueue.dart 341               NativeEnqueuerBase.processClass
package:compiler_unsupported/src/native/enqueue.dart 644               NativeCodegenEnqueuer.processClass
package:compiler_unsupported/src/native/enqueue.dart 318               NativeEnqueuerBase.enqueueClass.<fn>
package:compiler_unsupported/src/native/enqueue.dart 325               NativeEnqueuerBase.flushQueue
package:compiler_unsupported/src/native/enqueue.dart 438               NativeEnqueuerBase.registerNativeBehavior
package:compiler_unsupported/src/ssa/codegen.dart 1856                 SsaCodeGenerator.registerForeignTypes
package:compiler_unsupported/src/ssa/codegen.dart 1880                 SsaCodeGenerator.visitForeignCode
package:compiler_unsupported/src/ssa/nodes.dart 1857                   HForeignCode.accept
package:compiler_unsupported/src/ssa/codegen.dart 571                  SsaCodeGenerator.visit
package:compiler_unsupported/src/ssa/codegen.dart 577                  SsaCodeGenerator.visitExpression
package:compiler_unsupported/src/ssa/codegen.dart 558                  SsaCodeGenerator.use
package:compiler_unsupported/src/ssa/codegen.dart 454                  SsaCodeGenerator.visitArguments
package:compiler_unsupported/src/ssa/codegen.dart 1582                 SsaCodeGenerator.visitOneShotInterceptor
package:compiler_unsupported/src/ssa/nodes.dart 2528                   HOneShotInterceptor.accept
package:compiler_unsupported/src/ssa/codegen.dart 571                  SsaCodeGenerator.visit
package:compiler_unsupported/src/ssa/codegen.dart 577                  SsaCodeGenerator.visitExpression
package:compiler_unsupported/src/ssa/codegen.dart 558                  SsaCodeGenerator.use
package:compiler_unsupported/src/ssa/codegen.dart 2272                 SsaCodeGenerator.visitStringify
package:compiler_unsupported/src/ssa/nodes.dart 2910                   HStringify.accept
package:compiler_unsupported/src/ssa/codegen.dart 571                  SsaCodeGenerator.visit
package:compiler_unsupported/src/ssa/codegen.dart 577                  SsaCodeGenerator.visitExpression
package:compiler_unsupported/src/ssa/codegen.dart 543                  SsaCodeGenerator.define
package:compiler_unsupported/src/ssa/codegen.dart 1201                 SsaCodeGenerator.iterateBasicBlock
package:compiler_unsupported/src/ssa/codegen.dart 1089                 SsaCodeGenerator.visitBasicBlock
package:compiler_unsupported/src/ssa/codegen.dart 1350                 SsaCodeGenerator.visitGoto
package:compiler_unsupported/src/ssa/nodes.dart 2121                   HGoto.accept
package:compiler_unsupported/src/ssa/codegen.dart 571                  SsaCodeGenerator.visit
package:compiler_unsupported/src/ssa/codegen.dart 1206                 SsaCodeGenerator.iterateBasicBlock
package:compiler_unsupported/src/ssa/codegen.dart 1089                 SsaCodeGenerator.visitBasicBlock
package:compiler_unsupported/src/ssa/codegen.dart 291                  SsaCodeGenerator.visitGraph
package:compiler_unsupported/src/ssa/codegen.dart 65                   SsaCodeGeneratorTask.generateMethod.<fn>
package:compiler_unsupported/src/common/tasks.dart 55                  CompilerTask.measure
package:compiler_unsupported/src/ssa/codegen.dart 59                   SsaCodeGeneratorTask.generateMethod
package:compiler_unsupported/src/ssa/codegen.dart 41                   SsaCodeGeneratorTask.generateCode
package:compiler_unsupported/src/ssa/builder.dart 26                   SsaFunctionCompiler.compile
package:compiler_unsupported/src/js_backend/backend.dart 1593          JavaScriptBackend.codegen
package:compiler_unsupported/src/compiler.dart 1221                    Compiler.codegen
package:compiler_unsupported/src/common/codegen.dart 197               CodegenWorkItem.run
package:compiler_unsupported/src/compiler.dart 1100                    Compiler.emptyQueue.<fn>.<fn>
package:compiler_unsupported/src/compiler.dart 1689                    _CompilerDiagnosticReporter.withCurrentElement
package:compiler_unsupported/src/compiler.dart 1099                    Compiler.emptyQueue.<fn>
package:compiler_unsupported/src/enqueue.dart 1072                     QueueFilter.processWorkItem
package:compiler_unsupported/src/enqueue.dart 769                      Enqueuer.forEach
package:compiler_unsupported/src/compiler.dart 1098                    Compiler.emptyQueue
package:compiler_unsupported/src/compiler.dart 1126                    Compiler.processQueue
package:compiler_unsupported/src/compiler.dart 1049                    Compiler.compileLoadedLibraries
package:compiler_unsupported/src/compiler.dart 869                     Compiler.runCompiler.<fn>
@a14n
Copy link
Contributor Author

a14n commented Oct 30, 2015

There's no error if I change the dart file to :

import 'package:js/js.dart';

@JS()
class A {
  external A();
  external int aa();
}

@JS()
external A get a;

main() {
  print(a.aa());
  print(new A().aa());
}

@jacob314 jacob314 added the web-js-interop Issues that impact all js interop label Oct 30, 2015
@jacob314
Copy link
Member

strange. the error also goes away if you just add
document.querySelector("foobar")

@kevmoo kevmoo added the P1 A high priority bug; for example, a single project is unusable or has many test failures label Nov 18, 2015
@sigmundch
Copy link
Member

this was fixed together with #24974, the example no longer crashes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures web-dart2js web-js-interop Issues that impact all js interop
Projects
None yet
Development

No branches or pull requests

4 participants