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

CFE crash: Iterables do not have same length. #36356

Closed
aartbik opened this issue Mar 27, 2019 · 6 comments
Closed

CFE crash: Iterables do not have same length. #36356

aartbik opened this issue Mar 27, 2019 · 6 comments
Assignees
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. dartfuzz Found with Dart fuzzing (DartFuzz, libFuzzer, etc.) P1 A high priority bug; for example, a single project is unusable or has many test failures
Milestone

Comments

@aartbik
Copy link
Contributor

aartbik commented Mar 27, 2019

While experimenting with DartFuzz generalizations, I encountered the following crash in the CFE. It is possible the generated Dart program did not make sense at this point (attached as fuzz_fe.dart.txt, just remove the txt), but having the CFE crash seems undesirable in any case.

$ dart fuzz_fe.dart 
Crash when compiling file:///usr/local/google/home/ajcbik/Repo/DART/fuzz_fe.dart,
at character offset 39280:
Invalid argument(s): Iterables do not have same length.
#0      MapBase._fillMapWithIterables (dart:collection/maps.dart:91:7)
#1      new LinkedHashMap.fromIterables (dart:collection/linked_hash_map.dart:141:13)
#2      Substitution.fromPairs (package:kernel/type_algebra.dart:214:13)
#3      BodyBuilder.resolveRedirectingFactoryTargets (package:front_end/src/fasta/kernel/body_builder.dart:957:52)
#4      BodyBuilder.finishFunction (package:front_end/src/fasta/kernel/body_builder.dart:901:5)
#5      DietListener.listenerFinishFunction (package:front_end/src/fasta/source/diet_listener.dart:803:14)
#6      DietListener.buildFunctionBody (package:front_end/src/fasta/source/diet_listener.dart:837:7)
#7      DietListener.endMethod (package:front_end/src/fasta/source/diet_listener.dart:587:5)
#8      Parser.parseMethod (package:front_end/src/fasta/parser/parser.dart:3067:14)
#9      Parser.parseClassOrMixinMemberImpl (package:front_end/src/fasta/parser/parser.dart:2933:15)
#10     Parser.parseClassOrMixinBody (package:front_end/src/fasta/parser/parser.dart:2738:15)
#11     Parser.parseClass (package:front_end/src/fasta/parser/parser.dart:1762:13)
#12     Parser.parseClassOrNamedMixinApplication (package:front_end/src/fasta/parser/parser.dart:1722:14)
#13     Parser.parseTopLevelKeywordDeclaration (package:front_end/src/fasta/parser/parser.dart:574:14)
#14     Parser.parseTopLevelDeclarationImpl (package:front_end/src/fasta/parser/parser.dart:466:14)
#15     Parser.parseUnit (package:front_end/src/fasta/parser/parser.dart:349:15)
#16     SourceLoader.buildBody (package:front_end/src/fasta/source/source_loader.dart:262:14)
<asynchronous suspension>
#17     Loader.buildBodies (package:front_end/src/fasta/loader.dart:182:15)
<asynchronous suspension>
#18     KernelTarget.buildComponent.<anonymous closure> (package:front_end/src/fasta/kernel/kernel_target.dart:298:20)
<asynchronous suspension>
#19     withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)
<asynchronous suspension>
#20     KernelTarget.buildComponent (package:front_end/src/fasta/kernel/kernel_target.dart:296:12)
<asynchronous suspension>
#21     generateKernelInternal.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:145:38)
<asynchronous suspension>
#22     withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)
<asynchronous suspension>
#23     generateKernelInternal (package:front_end/src/kernel_generator_impl.dart:55:10)
<asynchronous suspension>
#24     generateKernel.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:40:18)
<asynchronous suspension>
#25     CompilerContext.runWithOptions.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:134:20)
<asynchronous suspension>
#26     CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:122:46)
#27     new Future.sync (dart:async/future.dart:224:31)
#28     CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:122:19)
#29     _rootRun (dart:async/zone.dart:1124:13)
#30     _CustomZone.run (dart:async/zone.dart:1021:19)
#31     _runZoned (dart:async/zone.dart:1516:10)
#32     runZoned (dart:async/zone.dart:1463:12)
#33     CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:121:12)
#34     CompilerContext.runWithOptions (package:front_end/src/fasta/compiler_context.dart:132:10)
#35     generateKernel (package:front_end/src/kernel_generator_impl.dart:39:32)
<asynchronous suspension>
#36     kernelForComponent (package:front_end/src/api_prototype/kernel_generator.dart:83:17)
<asynchronous suspension>
#37     SingleShotCompilerWrapper.compileInternal (file:///b/s/w/ir/cache/builder/sdk/pkg/vm/bin/kernel_service.dart:267:11)
<asynchronous suspension>
#38     Compiler.compile.<anonymous closure> (file:///b/s/w/ir/cache/builder/sdk/pkg/vm/bin/kernel_service.dart:144:31)
<asynchronous suspension>
#39     new Future.<anonymous closure> (dart:async/future.dart:176:37)
#40     _rootRun (dart:async/zone.dart:1120:38)
#41     _CustomZone.run (dart:async/zone.dart:1021:19)
#42     _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#43     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#44     _rootRun (dart:async/zone.dart:1124:13)
#45     _CustomZone.run (dart:async/zone.dart:1021:19)
#46     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
#47     Timer._createTimer.<anonymous closure> (dart:async/runtime/lib/timer_patch.dart:21:15)
#48     _Timer._runTimers (dart:isolate/runtime/lib/timer_impl.dart:382:19)
#49     _Timer._handleMessage (dart:isolate/runtime/lib/timer_impl.dart:416:5)
#50     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/lib/isolate_patch.dart:171:12)

@aartbik aartbik added area-front-end Use area-front-end for front end / CFE / kernel format related issues. dartfuzz Found with Dart fuzzing (DartFuzz, libFuzzer, etc.) labels Mar 27, 2019
@aartbik
Copy link
Contributor Author

aartbik commented Mar 27, 2019

fuzz_fe.dart.txt

@aartbik
Copy link
Contributor Author

aartbik commented Mar 27, 2019

I see this same crash when fuzzing spread operators. Please have a look.
@a-siva

@aartbik
Copy link
Contributor Author

aartbik commented Mar 28, 2019

Is this a known issue too? I am seeing this more and more while trying to come up with new spead/control-flow collection tests.

@aartbik aartbik added the P1 A high priority bug; for example, a single project is unusable or has many test failures label Mar 28, 2019
@aartbik aartbik added this to the Dart2.3 milestone Mar 28, 2019
@aartbik
Copy link
Contributor Author

aartbik commented Mar 29, 2019

It happens a lot less now than before, but it remains the second showstopper for long running fuzz testing sessions:

Isolate (/tmp/dart_fuzzBVYFET) JIT-O3-DebugX64 - JIT-STACKTRACEEVERY-ReleaseX64: !DIVERGENCE! 1.6:3057496967 (output=false)

fail1:
Crash when compiling file:///tmp/dart_fuzzBVYFET/fuzz.dart,
at character offset 135696:
Invalid argument(s): Iterables do not have same length.
#0      MapBase._fillMapWithIterables (dart:collection/maps.dart:85:7)
#1      new LinkedHashMap.fromIterables (dart:collection/linked_hash_map.dart:127:13)
#2      Substitution.fromPairs (package:kernel/type_algebra.dart:214:13)
#3      BodyBuilder.resolveRedirectingFactoryTargets (package:front_end/src/fasta/kernel/body_builder.dart:966:52)
#4      BodyBuilder.finishFunction (package:front_end/src/fasta/kernel/body_builder.dart:910:5)
#5      DietListener.listenerFinishFunction (package:front_end/src/fasta/source/diet_listener.dart:803:14)
#6      DietListener.buildFunctionBody (package:front_end/src/fasta/source/diet_listener.dart:837:7)
#7      DietListener.endMethod (package:front_end/src/fasta/source/diet_listener.dart:587:5)
#8      Parser.parseMethod (package:front_end/src/fasta/parser/parser.dart:3102:14)
#9      Parser.parseClassOrMixinMemberImpl (package:front_end/src/fasta/parser/parser.dart:2968:15)
#10     Parser.parseClassOrMixinBody (package:front_end/src/fasta/parser/parser.dart:2773:15)
#11     Parser.parseClass (package:front_end/src/fasta/parser/parser.dart:1757:13)
#12     Parser.parseClassOrNamedMixinApplication (package:front_end/src/fasta/parser/parser.dart:1717:14)
#13     Parser.parseTopLevelKeywordDeclaration (package:front_end/src/fasta/parser/parser.dart:569:14)
#14     Parser.parseTopLevelDeclarationImpl (package:front_end/src/fasta/parser/parser.dart:461:14)
#15     Parser.parseUnit (package:front_end/src/fasta/parser/parser.dart:344:15)
#16     SourceLoader.buildBody (package:front_end/src/fasta/source/source_loader.dart:272:14)
<asynchronous suspension>

@chloestefantsova
Copy link
Contributor

Not sure about this one. Will be investigating it on Monday.

Thanks for the repro!

@chloestefantsova
Copy link
Contributor

Proposed fix: https://dart-review.googlesource.com/c/sdk/+/98355. With it I was able to compile the repro fuzz_fe.dart without exceptions.

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. dartfuzz Found with Dart fuzzing (DartFuzz, libFuzzer, etc.) 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

3 participants