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

Crashing, regression with generic types #34856

Closed
kevmoo opened this issue Oct 18, 2018 · 5 comments
Closed

Crashing, regression with generic types #34856

kevmoo opened this issue Oct 18, 2018 · 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. front-end-kernel P1 A high priority bug; for example, a single project is unusable or has many test failures
Milestone

Comments

@kevmoo
Copy link
Member

kevmoo commented Oct 18, 2018

Crashing on 5f4511a
Works fine on 2.1.0-dev.7.0

Sorry the repro is crazy. If I have time, I'll try to make it easier.

  1. Sync https://github.com/kevmoo/graph (verified at master kevmoo/graph@e19a763)
  2. pub get
  3. pub run test
  Failed to load "test/graph_test.dart":
  Unable to spawn isolate: Type parameter dart.collection::UnmodifiableMapView::K is not indexed
  #0      TypeParameterIndexer.[] (package:kernel/binary/ast_to_binary.dart:2055:28)
  #1      BinaryPrinter.visitTypeParameterType (package:kernel/binary/ast_to_binary.dart:1678:38)
  #2      TypeParameterType.accept (package:kernel/ast.dart:4890:34)
  #3      BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:250:10)
  #4      LimitedBinaryPrinter.writeNode (package:kernel/binary/limited_ast_to_binary.dart:55:11)
  #5      BinaryPrinter.writeNodeList (package:kernel/binary/ast_to_binary.dart:242:7)
  #6      BinaryPrinter.visitInterfaceType (package:kernel/binary/ast_to_binary.dart:1629:7)
  #7      InterfaceType.accept (package:kernel/ast.dart:4629:34)
  #8      BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:250:10)
  #9      LimitedBinaryPrinter.writeNode (package:kernel/binary/limited_ast_to_binary.dart:55:11)
  #10     BinaryPrinter.writeVariableDeclaration (package:kernel/binary/ast_to_binary.dart:1573:5)
  #11     List.forEach (dart:core/runtime/libgrowable_array.dart:278:8)
  #12     BinaryPrinter.writeList (package:kernel/binary/ast_to_binary.dart:234:11)
  #13     BinaryPrinter.writeVariableDeclarationList (package:kernel/binary/ast_to_binary.dart:1581:5)
  #14     BinaryPrinter.visitFunctionNode (package:kernel/binary/ast_to_binary.dart:977:5)
  #15     FunctionNode.accept (package:kernel/ast.dart:2077:30)
  #16     BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:250:10)
  #17     LimitedBinaryPrinter.writeNode (package:kernel/binary/limited_ast_to_binary.dart:55:11)
  #18     BinaryPrinter.visitConstructor (package:kernel/binary/ast_to_binary.dart:809:5)
  #19     Constructor.accept (package:kernel/ast.dart:1367:32)
  #20     BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:250:10)
  #21     LimitedBinaryPrinter.writeNode (package:kernel/binary/limited_ast_to_binary.dart:55:11)
  #22     BinaryPrinter.writeNodeList (package:kernel/binary/ast_to_binary.dart:242:7)
  #23     BinaryPrinter.visitClass (package:kernel/binary/ast_to_binary.dart:770:5)
  #24     Class.accept (package:kernel/ast.dart:972:30)
  #25     BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:250:10)
  #26     LimitedBinaryPrinter.writeNode (package:kernel/binary/limited_ast_to_binary.dart:55:11)
  #27     BinaryPrinter.writeNodeList (package:kernel/binary/ast_to_binary.dart:242:7)
  #28     BinaryPrinter.visitLibrary (package:kernel/binary/ast_to_binary.dart:620:5)
  #29     Library.accept (package:kernel/ast.dart:409:30)
  #30     BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:250:10)
  #31     LimitedBinaryPrinter.writeNode (package:kernel/binary/limited_ast_to_binary.dart:55:11)
  #32     List.forEach (dart:core/runtime/libgrowable_array.dart:278:8)
  #33     BinaryPrinter.writeList (package:kernel/binary/ast_to_binary.dart:234:11)
  #34     LimitedBinaryPrinter.writeLibraries (package:kernel/binary/limited_ast_to_binary.dart:49:5)
  #35     BinaryPrinter.writeComponentFile (package:kernel/binary/ast_to_binary.dart:328:5)
  #36     serializeComponent (package:front_end/src/fasta/kernel/utils.dart:68:11)
  #37     _processLoadRequest (file:///Users/kevmoo/source/github/dart/sdk/pkg/vm/bin/kernel_service.dart:444:11)
  <asynchronous suspension>
  #38     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
00:01 +0 -1: Some tests failed.
@kevmoo kevmoo added P1 A high priority bug; for example, a single project is unusable or has many test failures area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. crash Process exits with SIGSEGV, SIGABRT, etc. An unhandled exception is not a crash. front-end-kernel labels Oct 18, 2018
@kevmoo kevmoo added this to the Dart2.1 milestone Oct 18, 2018
@a-siva a-siva added area-front-end Use area-front-end for front end / CFE / kernel format related issues. and removed area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. labels Oct 18, 2018
@kmillikin
Copy link

kmillikin commented Oct 19, 2018

We can reproduce this. It looks like there is a missing substitution on a mixin application's superclass constructor.

@dgrove
Copy link
Contributor

dgrove commented Oct 19, 2018

Any updates on ETA on this?

@keertip
Copy link
Contributor

keertip commented Oct 19, 2018

Seeing this internally too with bleeding edge testing.

@peter-ahe-google
Copy link
Contributor

Smaller repro:

==> issue34856/repo.dart <==
import 'lib.dart';

abstract class M<M_K, M_V> implements Map<M_K, Set<M_V>> {}

abstract class C<C_K, C_V> extends UnmodifiableMapView<C_K, Set<C_V>>
    with M<C_K, C_V> {
  C._() : super(null);
}

==> issue34856/lib.dart <==
abstract class MapView<K, V> implements Map<K, V> {
  const MapView(Map<K, V> map);
}

abstract class _UnmodifiableMapMixin<K, V> implements Map<K, V> {}

abstract class UnmodifiableMapView<K, V> extends MapView<K, V>
    with _UnmodifiableMapMixin<K, V> {
  UnmodifiableMapView(Map<K, V> map) : super(map);
}

Then run:

$ ./sdk/bin/dart ./pkg/front_end/tool/_fasta/compile.dart issue34856/lib.dart
$ ./sdk/bin/dart ./pkg/front_end/tool/_fasta/compile.dart --platform=issue34856/lib.dart.dill issue34856/repo.dart

Notice that this doesn't repo when issue34856/lib.dart is loaded from source.

@peter-ahe-google
Copy link
Contributor

dart-bot pushed a commit that referenced this issue Oct 22, 2018
Also, change the signature to return a kernel substitution map.

This prepares for fixing issue #34856,
as DillClassBuilders don't have builder wrappers for type variables and
supertypes.

Change-Id: Ia3f2458852ffaad766c44f62fd93e68234650126
Reviewed-on: https://dart-review.googlesource.com/c/81002
Reviewed-by: Kevin Millikin <[email protected]>
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. front-end-kernel P1 A high priority bug; for example, a single project is unusable or has many test failures
Projects
None yet
Development

No branches or pull requests

6 participants