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

test_api: crashes w/ dart2js with latest deployment #1141

Closed
kevmoo opened this issue Jan 11, 2020 · 5 comments · Fixed by #1147
Closed

test_api: crashes w/ dart2js with latest deployment #1141

kevmoo opened this issue Jan 11, 2020 · 5 comments · Fixed by #1147

Comments

@kevmoo
Copy link
Member

kevmoo commented Jan 11, 2020

See

https://travis-ci.org/dart-lang/yaml/jobs/635401215#L240
https://travis-ci.org/dart-lang/crypto/jobs/635401249#L240
https://travis-ci.org/dart-lang/typed_data/jobs/635046175#L240

Might be a dart2js issue that was caused by recent release... Only happens with Dart 2.3

CC @natebosch @grouma @sigmundch

../../../.pub-cache/hosted/pub.dartlang.org/test_api-0.2.12/lib/src/backend/platform_selector.dart:13:7:
Internal Error: The compiler crashed when compiling this element.
final _universalValidVariables = {
      ^
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.3.0), and
* the entire message you see here (including the full stack trace
  below as well as the source location above).
The compiler crashed: NoSuchMethodError: The method 'add' was called on null.
Receiver: null
Tried calling: add(Instance of 'VariableDeclaration')
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:50:5)
#1      StaticTypeVisitor.visitVariableDeclaration (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/ir/static_type.dart:1361:23)
#2      VariableDeclaration.accept (package:kernel/ast.dart:4647:35)
#3      StaticTypeBase.visitNode (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/ir/static_type_base.dart:76:18)
#4      StaticTypeVisitor.visitBlock (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/ir/static_type.dart:956:22)
#5      Block.accept (package:kernel/ast.dart:3941:35)
#6      StaticTypeBase.visitNode (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/ir/static_type_base.dart:76:18)
#7      StaticTypeVisitor.visitBlockExpression (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/ir/static_type.dart:928:5)
#8      BlockExpression.accept (package:kernel/ast.dart:3828:36)
#9      StaticTypeBase.visitNode (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/ir/static_type_base.dart:76:18)
#10     StaticTypeVisitor.visitField (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/ir/static_type.dart:1352:5)
#11     Field.accept (package:kernel/ast.dart:1309:32)
#12     KernelToElementMapImpl.computeWorldImpact (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/kernel/element_map_impl.dart:1391:12)
#13     KernelWorkItem.run.<anonymous closure>.<anonymous closure> (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/kernel/kernel_strategy.dart:300:47)
#14     CompilerTask.measureSubtask (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/common/tasks.dart:179:35)
#15     KernelWorkItem.run.<anonymous closure> (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/kernel/kernel_strategy.dart:299:28)
#16     CompilerTask.measure (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/common/tasks.dart:64:51)
#17     KernelWorkItem.run (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/kernel/kernel_strategy.dart:274:26)
#18     Compiler.emptyQueue.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure> (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/compiler.dart:466:70)
#19     CompilerTask.measureSubtask (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/common/tasks.dart:179:35)
#20     Compiler.emptyQueue.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure> (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/compiler.dart:466:32)
#21     CompilerTask.measureSubtask (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/common/tasks.dart:179:35)
#22     Compiler.emptyQueue.<anonymous closure>.<anonymous closure>.<anonymous closure> (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/compiler.dart:464:28)
#23     CompilerDiagnosticReporter.withCurrentElement (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/compiler.dart:784:15)
#24     Compiler.emptyQueue.<anonymous closure>.<anonymous closure> (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/compiler.dart:462:18)
#25     ResolutionEnqueuer._forEach (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/enqueue.dart:445:12)
#26     ResolutionEnqueuer.forEach (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/enqueue.dart:461:5)
#27     Compiler.emptyQueue.<anonymous closure> (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/compiler.dart:458:16)
#28     CompilerTask.measureSubtask (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/common/tasks.dart:179:35)
#29     Compiler.emptyQueue (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/compiler.dart:457:14)
#30     Compiler.processQueue.<anonymous closure> (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/compiler.dart:483:7)
#31     CompilerTask.measureSubtask (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/common/tasks.dart:179:35)
#32     Compiler.processQueue (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/compiler.dart:476:14)
#33     Compiler.computeClosedWorld (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/compiler.dart:336:5)
#34     Compiler.compileFromKernel.<anonymous closure>.<anonymous closure> (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/compiler.dart:405:17)
#35     CompilerTask.measureSubtask (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/common/tasks.dart:179:35)
#36     Compiler.compileFromKernel.<anonymous closure> (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/compiler.dart:404:43)
#37     CompilerTask.measureSubtask (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/common/tasks.dart:179:35)
#38     Compiler.compileFromKernel (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/compiler.dart:403:14)
#39     Compiler.runInternal (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/compiler.dart:272:13)
<asynchronous suspension>
#40     Compiler.run.<anonymous closure>.<anonymous closure> (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/compiler.dart:223:38)
#41     new Future.sync (dart:async/future.dart:224:31)
#42     Compiler.run.<anonymous closure> (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/compiler.dart:223:20)
#43     CompilerTask.measureSubtask (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/common/tasks.dart:179:35)
#44     Compiler.run (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/compiler.dart:220:41)
#45     CompilerImpl.run.<anonymous closure>.<anonymous closure> (file:///b/s/w/ir/cache/builder/sdk/pkg/compiler/lib/src/apiimpl.dart:91:22)
#46     _RootZone.runUnary (dart:async/zone.dart:1379:54)
#47     _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
#48     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
#49     Future._propagateToListeners (dart:async/future_impl.dart:668:32)
#50     Future._completeWithValue (dart:async/future_impl.dart:483:5)
#51     Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:513:7)
#52     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#53     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#54     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:115:13)
#55     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:5)
@kevmoo
Copy link
Member Author

kevmoo commented Jan 11, 2020

@kevmoo
Copy link
Member Author

kevmoo commented Jan 11, 2020

Ooo...only seems to come up w/ Dart 2.3

@natebosch
Copy link
Member

Likely the crash is related to the for-loop elements

for (var runtime in Runtime.builtIn) runtime.identifier,
for (var os in OperatingSystem.all) os.identifier,

Those should be supported in that SDK, but maybe dart2js had a bug?

@sigmundch - do you recall anything bugs we have fixed since that release around for-loop elements?

@sigmundch
Copy link
Member

Yes. See http://github.com/dart-lang/sdk/commit/9ac7bd78550ac5c73b2131a71751a30e6ae967e7 (fixing dart-lang/sdk#36864)
It made it to the next 2.3.-dev release, but apparently there wasn't another stable release until 2.4.0 where the fix was finally in the stable channel.

kevmoo added a commit to dart-lang/yaml that referenced this issue Jan 12, 2020
kevmoo added a commit to dart-lang/typed_data that referenced this issue Jan 12, 2020
kevmoo added a commit to dart-lang/yaml that referenced this issue Jan 13, 2020
kevmoo added a commit to dart-lang/typed_data that referenced this issue Jan 13, 2020
natebosch added a commit that referenced this issue Jan 14, 2020
Towards #1141

Work around the bug in the SDK by switching back to `..addAll`. After we
publish this version that works we can bump the min SDK.

Prepare to publish.
natebosch added a commit that referenced this issue Jan 19, 2020
Towards #1141

Work around the bug in the SDK by switching back to `..addAll`. After we
publish this version that works we can bump the min SDK.

Prepare to publish.
natebosch added a commit that referenced this issue Jan 19, 2020
Close #1141

Bump min SDK in all packages for safety. Restore use of for-loop
elements in a top level variable since they work in this SDK.
@natebosch
Copy link
Member

We have a version published now that should work, a pub upgrade should resolve things locally.

natebosch added a commit that referenced this issue Jan 21, 2020
Closes #1141

Bump min SDK in all packages for safety. Restore use of for-loop
elements in a top level variable since they work in this SDK.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants