dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.28k stars 1.58k forks source link

Hitting unhandled InterfaceConflict in CFE #40528

Closed vsmenon closed 4 years ago

vsmenon commented 4 years ago

When running AngularDart Gallery with the DDC unfork CL, I started hitting (only in the past day):

Crash when compiling null,
at character offset null:
Bad state: Too many elements
#0      List.single (dart:core-patch/growable_array.dart:230:5)
#1      AbstractMemberOverridingImplementation.selectConcrete (package:front_end/src/fasta/kernel/class_hierarchy_builder.dart:2723:54)
#2      ClassHierarchyNodeBuilder.handleMergeConflict (package:front_end/src/fasta/kernel/class_hierarchy_builder.dart:489:56)
#3      ClassHierarchyNodeBuilder.merge (package:front_end/src/fasta/kernel/class_hierarchy_builder.dart:1742:32)
#4      ClassHierarchyNodeBuilder.build (package:front_end/src/fasta/kernel/class_hierarchy_builder.dart:1341:22)
#5      ClassHierarchyBuilder.build (package:front_end/src/fasta/kernel/class_hierarchy_builder.dart:413:68)
#6      SourceLoader.buildClassHierarchy (package:front_end/src/fasta/source/source_loader.dart:1078:46)
#7      KernelTarget.buildOutlines.<anonymous closure> (package:front_end/src/fasta/kernel/kernel_target.dart:310:14)
<asynchronous suspension>
#8      withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)
#9      KernelTarget.buildOutlines (package:front_end/src/fasta/kernel/kernel_target.dart:288:12)
#10     IncrementalCompiler.computeDelta.<anonymous closure> (package:front_end/src/fasta/incremental_compiler.dart:231:52)
<asynchronous suspension>
#11     CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:123:46)

At the point of the crash, there are two declarations, not just one:

declaration: InterfaceConflict(Object with MaterialTreeRoot<T>, [Object.toString, SelectionContainer.toString])
declaration.declarations: [DillMemberBuilder(Object.toString), DillMemberBuilder(SelectionContainer.toString)]

This appears to be the class in question:

https://github.com/dart-lang/angular_components/blob/master/angular_components/lib/src/material_tree/material_tree_root.dart#L10

fyi @johnniwinther @stefantsov

johnniwinther commented 4 years ago

This has likely been fixed already. @vsmenon can you verify?

johnniwinther commented 4 years ago

Closing this for now since the underlying structure has been completely refactored in https://dart-review.googlesource.com/c/sdk/+/138294

Do open again if the problem persists.