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

dartanalyzer crashes when .packages target is empty #24126

Closed
harryterkelsen opened this issue Aug 18, 2015 · 8 comments
Closed

dartanalyzer crashes when .packages target is empty #24126

harryterkelsen opened this issue Aug 18, 2015 · 8 comments
Assignees
Labels
analyzer-command Issues with the command-line dartanalyzer tool area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on
Milestone

Comments

@harryterkelsen
Copy link
Contributor

.packages:

foo:

stderr:

Bad state: No element
#0      List.last (dart:core-patch/growable_array.dart:212)
#1      startsWith (package:analyzer/src/generated/utilities_dart.dart:47:20)
#2      SourceFactory._getPackageMapping.<anonymous closure> (package:analyzer/src/generated/source.dart:786:13)
#3      _HashVMBase&MapMixin&&_LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:340)
#4      MapView.forEach (dart:collection/maps.dart:194)
#5      SourceFactory._getPackageMapping (package:analyzer/src/generated/source.dart:784:23)
#6      SourceFactory.restoreUri (package:analyzer/src/generated/source.dart:762:32)
#7      Driver._computeLibrarySource (package:analyzer_cli/src/driver.dart:341:38)
#8      Driver._analyzeAll (package:analyzer_cli/src/driver.dart:137:23)
#9      Driver.start.<anonymous closure> (package:analyzer_cli/src/driver.dart:99:16)
#10     _BatchRunner.runAsBatch.<anonymous closure> (package:analyzer_cli/src/driver.dart:536:39)
#11     _RootZone.runUnaryGuarded (dart:async/zone.dart:1103)
#12     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341)
#13     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:270)
#14     _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:67)
#15     _EventSinkWrapper.add (dart:async/stream_transformers.dart:14)
#16     _StringAdapterSink.add (dart:convert/string_conversion.dart:256)
#17     _LineSplitterSink._addLines (dart:convert/line_splitter.dart:127)
#18     _LineSplitterSink.addSlice (dart:convert/line_splitter.dart:102)
#19     StringConversionSinkMixin.add (dart:convert/string_conversion.dart:180)
#20     _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:80)
#21     _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:119)
#22     _RootZone.runUnaryGuarded (dart:async/zone.dart:1103)
#23     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341)
#24     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:270)
#25     _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:67)
#26     _EventSinkWrapper.add (dart:async/stream_transformers.dart:14)
#27     _StringAdapterSink.add (dart:convert/string_conversion.dart:256)
#28     _StringAdapterSink.addSlice (dart:convert/string_conversion.dart:260)
#29     _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:336)
#30     _Utf8ConversionSink.add (dart:convert/string_conversion.dart:329)
#31     _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:80)
#32     _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:119)
#33     _RootZone.runUnaryGuarded (dart:async/zone.dart:1103)
#34     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341)
#35     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:270)
#36     _StreamController&&_SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:744)
#37     _StreamController._add (dart:async/stream_controller.dart:616)
#38     _StreamController.add (dart:async/stream_controller.dart:562)
#39     _Socket._onData (dart:io-patch/socket_patch.dart:1793)
#40     _RootZone.runUnaryGuarded (dart:async/zone.dart:1103)
#41     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341)
#42     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:270)
#43     _StreamController&&_SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:744)
#44     _StreamController._add (dart:async/stream_controller.dart:616)
#45     _StreamController.add (dart:async/stream_controller.dart:562)
#46     _RawSocket._RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1344)
#47     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:728)
#48     _microtaskLoop (dart:async/schedule_microtask.dart:43)
#49     _microtaskLoopEntry (dart:async/schedule_microtask.dart:52)
#50     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)
#51     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:149)
@bwilkerson bwilkerson added Type-Defect area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-command Issues with the command-line dartanalyzer tool labels Aug 18, 2015
@bwilkerson
Copy link
Member

This looks like an invalid .packages file that should have been caught by the code that reads the .packages file.

@harryterkelsen
Copy link
Contributor Author

We are asking Lasse what the appropriate thing to do is in this case:
https://codereview.chromium.org/1298323002/

On Tue, Aug 18, 2015, 4:50 PM Brian Wilkerson [email protected]
wrote:

This looks like an invalid .packages file that should have been caught by
the code that reads the .packages file.


Reply to this email directly or view it on GitHub
#24126 (comment).

@pq
Copy link
Member

pq commented Aug 19, 2015

We are asking Lasse what the appropriate thing to do is in this case:
https://codereview.chromium.org/1298323002/

Awesome. Please update this issue when we know where we're headed. It'd be easy enough to guard against on our end but probably better handled in package_config once and for all rather than in all the clients.

@sethladd
Copy link
Contributor

This crash looks like a "real" crash, and thus a candidate for fixing for 1.12.

@pq
Copy link
Member

pq commented Aug 19, 2015

This crash looks like a "real" crash, and thus a candidate for fixing for 1.12.

Agreed.

We should fix it in package_config. Feel free to open a bug there and assign it to me and I'll happily take a look.

@pq
Copy link
Member

pq commented Aug 19, 2015

We should fix it in package_config. Feel free to open a bug there and assign it to me and I'll happily take a look.

Actually, I'm less sure now. I'm looking into it.

@pq
Copy link
Member

pq commented Aug 19, 2015

@pq pq added this to the 1.12 milestone Aug 19, 2015
pq added a commit that referenced this issue Aug 19, 2015
Fixes issue where `.packages` provides a key mapped to an empty value (#24126).

[email protected]

Review URL: https://codereview.chromium.org//1298393004 .
@pq
Copy link
Member

pq commented Aug 19, 2015

Fixed with e11ce8b.

Request to merge to dev filed here: #24138.

@pq pq closed this as completed Aug 19, 2015
pq added a commit that referenced this issue Aug 20, 2015
Fixes issue where `.packages` provides a key mapped to an empty value (#24126).

[email protected]

Review URL: https://codereview.chromium.org//1298393004 .
@kevmoo kevmoo added P2 A bug or feature request we're likely to work on and removed Priority-Medium labels Mar 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-command Issues with the command-line dartanalyzer tool area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

5 participants