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

License detection crashing for sqfentity version 1.2.3+10 #1014

Closed
jonasfj opened this issue Feb 7, 2022 · 4 comments · Fixed by #1021
Closed

License detection crashing for sqfentity version 1.2.3+10 #1014

jonasfj opened this issue Feb 7, 2022 · 4 comments · Fixed by #1021
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@jonasfj
Copy link
Member

jonasfj commented Feb 7, 2022

License detection of sqfentity version 1.2.3+10 probably creates a SourceSpan that can't be render, or something like that.

Probably something is stripping a new-line at the end of string which then violates some assertion.

pub.analyzer.pana: Failed (v0.21.7) - sqfentity/1.2.3+10

Error:
    Invalid argument(s): The context line "/****************************   LICENSE   *****************************
    
    Copyright (C) 2019, HUSEYIN TOKPUNAR http://huseyintokpinar.com/
    
    Download & Update Latest Version: https://github.com/hhtokpinar/sqfEntity
    
    Licensed under the Apache License, Version 2.0 (the 'License');
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    
        http://www.apache.org/licenses/LICENSE-2.0
    
    Unless required by applicable law or agreed to in writing, software
    " must contain "/****************************   LICENSE   *****************************
    
    Copyright (C) 2019, HUSEYIN TOKPUNAR http://huseyintokpinar.com/
    
    Download & Update Latest Version: https://github.com/hhtokpinar/sqfEntity
    
    Licensed under the Apache License, Version 2.0 (the 'License');
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    
        http://www.apache.org/licenses/LICENSE-2.0
    
    Unless required by applicable law or agreed to in writing, software
".

Stack:
    #0      new SourceSpanWithContext (package:source_span/src/span_with_context.dart:28:7)
    #1      _Highlight._normalizeNewlines (package:source_span/src/highlighter.dart:567:12)
    #2      new _Highlight.<anonymous closure> (package:source_span/src/highlighter.dart:528:21)
    #3      new _Highlight (package:source_span/src/highlighter.dart:531:11)
    #4      new Highlighter (package:source_span/src/highlighter.dart:62:31)
    #5      SourceSpanMixin.highlight (package:source_span/src/span_mixin.dart:72:12)
    #6      _extension#0.markdown (package:pana/src/report/_common.dart:25:17)
    #7      Issue.markdown (package:pana/src/report/_common.dart:79:30)
    #8      _makeSummary.<anonymous closure>.<anonymous closure> (package:pana/src/report/_common.dart:129:25)
    #9      MappedIterator.moveNext (dart:_internal/iterable.dart:391:20)
    #10     List.addAll (dart:core-patch/growable_array.dart:315:13)
    #11     _makeSummary.<anonymous closure> (package:pana/src/report/_common.dart:136:12)
    #12     MappedListIterable.elementAt (dart:_internal/iterable.dart:413:31)
    #13     ListIterator.moveNext (dart:_internal/iterable.dart:342:26)
    #14     List.addAll (dart:core-patch/growable_array.dart:315:13)
    #15     _makeSummary (package:pana/src/report/_common.dart:126:20)
    #16     makeSection (package:pana/src/report/_common.dart:184:11)
    #17     staticAnalysis (package:pana/src/report/static_analysis.dart:56:10)
    <asynchronous suspension>
    #18     StackZoneSpecification._registerUnaryCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart)
    <asynchronous suspension>
@jonasfj jonasfj added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Feb 7, 2022
@sigurdm
Copy link
Contributor

sigurdm commented Feb 7, 2022

Reproduces locally:

dart run pana --hosted sqfentity 1.2.3+10

@jonasfj
Copy link
Member Author

jonasfj commented Feb 7, 2022

/cc @bharat-biradar in case you're interested.

@isoos
Copy link
Collaborator

isoos commented Feb 23, 2022

This is not a license issue, rather a SourceSpan originating from here:
https://github.com/dart-lang/pana/blob/master/lib/src/report/static_analysis.dart#L86-L91

When I comment out the length limiting part, the analysis goes through. Not yet sure if we are doing something wrong (although this may be likely), or it is a bug in the dependent libraries.

@isoos
Copy link
Collaborator

isoos commented Feb 23, 2022

Identified a package:source_span issue: dart-lang/source_span#79

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants