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

Analyzer crash #57045

Open
sigurdm opened this issue Nov 7, 2024 · 3 comments
Open

Analyzer crash #57045

sigurdm opened this issue Nov 7, 2024 · 3 comments
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@sigurdm
Copy link
Contributor

sigurdm commented Nov 7, 2024

https://github.com/dart-lang/webdev/actions/runs/11721785765/job/32652333411?pr=2511

Reproduction:
Use Dart SDK version 3.7.0-99.0.dev

Check out https://github.com/sigurdm/webdev at 5209806a3050bf181a1b3a7f69b580b54e9743ca

Run dart analyze

Stacktrace
Analyzing ....
An unexpected error was encountered by the Analysis Server.
Please file an issue at https://github.com/dart-lang/sdk/issues/new/choose with the following details:
Internal error: Exception while using a AvoidClassesWithOnlyStaticMembers to visit a ClassDeclarationImpl in CompilationUnitImpl
type 'MethodMember' is not a subtype of type 'ExecutableFragment' in type cast
#0      Interface.map2.<anonymous closure> (package:analyzer/src/dart/element/inheritance_manager3.dart:1290:33)
#1      MapBase.map (dart:collection/maps.dart:82:28)
#2      Interface.map2 (package:analyzer/src/dart/element/inheritance_manager3.dart:1289:16)
#3      _Visitor.visitClassDeclaration (package:linter/src/rules/avoid_classes_with_only_static_members.dart:46:25)
#4      ClassDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:2882:50)
#5      AnalysisRuleVisitor._runSubscriptions (package:analyzer/src/lint/linter_visitor.dart:[10](https://github.com/dart-lang/webdev/actions/runs/11721785765/job/32652333411?pr=2511#step:7:11)86:14)
#6      AnalysisRuleVisitor.visitClassDeclaration (package:analyzer/src/lint/linter_visitor.dart:161:5)
#7      ClassDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:2882:50)
#8      NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:12930:20)
#9      CompilationUnitImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:3555:21)
#10     AnalysisRuleVisitor.visitCompilationUnit (package:analyzer/src/lint/linter_visitor.dart:186:10)
#[11](https://github.com/dart-lang/webdev/actions/runs/11721785765/job/32652333411?pr=2511#step:7:12)     CompilationUnitImpl.accept (package:analyzer/src/dart/ast/ast.dart:3548:50)
#12     LibraryAnalyzer._computeLints (package:analyzer/src/dart/analysis/library_analyzer.dart:410:12)
#13     LibraryAnalyzer._computeDiagnostics (package:analyzer/src/dart/analysis/library_analyzer.dart:334:7)
#14     LibraryAnalyzer.analyze (package:analyzer/src/dart/analysis/library_analyzer.dart:109:5)
#15     AnalysisDriver._analyzeFileImpl.<anonymous closure> (package:analyzer/src/dart/analysis/driver.dart:1397:11)
<asynchronous suspension>
#16     PerformanceLog.runAsync (package:analyzer/src/dart/analysis/performance_logger.dart:50:14)
<asynchronous suspension>
#17     AnalysisDriver._analyzeFile.<anonymous closure> (package:analyzer/src/dart/analysis/driver.dart:1311:9)
<asynchronous suspension>
#18     OperationPerformanceImpl.runAsync (package:analyzer/src/util/performance/operation_performance.dart:174:14)
<asynchronous suspension>
#19     AnalysisDriver._analyzeFile (package:analyzer/src/dart/analysis/driver.dart:1308:5)
<asynchronous suspension>
#20     AnalysisDriver._produceErrors (package:analyzer/src/dart/analysis/driver.dart:2013:5)
<asynchronous suspension>
#21     AnalysisDriver.performWork (package:analyzer/src/dart/analysis/driver.dart:1248:7)
<asynchronous suspension>
#22     AnalysisDriverScheduler._run (package:analyzer/src/dart/analysis/driver.dart:2442:7)
<asynchronous suspension>
null
An unexpected error was encountered by the Analysis Server.
Please file an issue at https://github.com/dart-lang/sdk/issues/new/choose with the following details:
Internal error: Exception while using a AvoidClassesWithOnlyStaticMembers to visit a ClassDeclarationImpl in CompilationUnitImpl
type 'MethodMember' is not a subtype of type 'ExecutableFragment' in type cast
#0      Interface.map2.<anonymous closure> (package:analyzer/src/dart/element/inheritance_manager3.dart:[12](https://github.com/dart-lang/webdev/actions/runs/11721785765/job/32652333411?pr=2511#step:7:13)90:33)
#1      MapBase.map (dart:collection/maps.dart:82:28)
#2      Interface.map2 (package:analyzer/src/dart/element/inheritance_manager3.dart:1289:16)
#3      _Visitor.visitClassDeclaration (package:linter/src/rules/avoid_classes_with_only_static_members.dart:46:25)
#4      ClassDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:2882:50)
#5      AnalysisRuleVisitor._runSubscriptions (package:analyzer/src/lint/linter_visitor.dart:1086:14)
#6      AnalysisRuleVisitor.visitClassDeclaration (package:analyzer/src/lint/linter_visitor.dart:161:5)
#7      ClassDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:2882:50)
#8      NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:12930:20)
#9      CompilationUnitImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:3555:21)
#10     AnalysisRuleVisitor.visitCompilationUnit (package:analyzer/src/lint/linter_visitor.dart:186:10)
#11     CompilationUnitImpl.accept (package:analyzer/src/dart/ast/ast.dart:3548:50)
#12     LibraryAnalyzer._computeLints (package:analyzer/src/dart/analysis/library_analyzer.dart:410:12)
#[13](https://github.com/dart-lang/webdev/actions/runs/11721785765/job/32652333411?pr=2511#step:7:14)     LibraryAnalyzer._computeDiagnostics (package:analyzer/src/dart/analysis/library_analyzer.dart:334:7)
#[14](https://github.com/dart-lang/webdev/actions/runs/11721785765/job/32652333411?pr=2511#step:7:15)     LibraryAnalyzer.analyze (package:analyzer/src/dart/analysis/library_analyzer.dart:109:5)
#15     AnalysisDriver._analyzeFileImpl.<anonymous closure> (package:analyzer/src/dart/analysis/driver.dart:1397:11)
<asynchronous suspension>
#16     PerformanceLog.runAsync (package:analyzer/src/dart/analysis/performance_logger.dart:50:14)
<asynchronous suspension>
#17     AnalysisDriver._analyzeFile.<anonymous closure> (package:analyzer/src/dart/analysis/driver.dart:1311:9)
<asynchronous suspension>
#18     OperationPerformanceImpl.runAsync (package:analyzer/src/util/performance/operation_performance.dart:174:14)
<asynchronous suspension>
#19     AnalysisDriver._analyzeFile (package:analyzer/src/dart/analysis/driver.dart:1308:5)
<asynchronous suspension>
#20     AnalysisDriver._produceErrors (package:analyzer/src/dart/analysis/driver.dart:2013:5)
<asynchronous suspension>
#21     AnalysisDriver.performWork (package:analyzer/src/dart/analysis/driver.dart:1248:7)
<asynchronous suspension>
#22     AnalysisDriverScheduler._run (package:analyzer/src/dart/analysis/driver.dart:2442:7)
<asynchronous suspension>
null
An unexpected error was encountered by the Analysis Server.
Please file an issue at https://github.com/dart-lang/sdk/issues/new/choose with the following details:
Internal error: Exception while using a AvoidClassesWithOnlyStaticMembers to visit a ClassDeclarationImpl in CompilationUnitImpl
type 'MethodMember' is not a subtype of type 'ExecutableFragment' in type cast
#0      Interface.map2.<anonymous closure> (package:analyzer/src/dart/element/inheritance_manager3.dart:1290:33)
#1      MapBase.map (dart:collection/maps.dart:82:28)
#2      Interface.map2 (package:analyzer/src/dart/element/inheritance_manager3.dart:1289:16)
#3      _Visitor.visitClassDeclaration (package:linter/src/rules/avoid_classes_with_only_static_members.dart:46:25)
#4      ClassDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:2882:50)
#5      AnalysisRuleVisitor._runSubscriptions (package:analyzer/src/lint/linter_visitor.dart:1086:14)
#6      AnalysisRuleVisitor.visitClassDeclaration (package:analyzer/src/lint/linter_visitor.dart:161:5)
#7      ClassDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:2882:50)
#8      NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:12930:20)
#9      CompilationUnitImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:3555:21)
#10     AnalysisRuleVisitor.visitCompilationUnit (package:analyzer/src/lint/linter_visitor.dart:186:10)
#11     CompilationUnitImpl.accept (package:analyzer/src/dart/ast/ast.dart:3548:50)
#12     LibraryAnalyzer._computeLints (package:analyzer/src/dart/analysis/library_analyzer.dart:410:12)
#13     LibraryAnalyzer._computeDiagnostics (package:analyzer/src/dart/analysis/library_analyzer.dart:334:7)
#14     LibraryAnalyzer.analyze (package:analyzer/src/dart/analysis/library_analyzer.dart:109:5)
#[15](https://github.com/dart-lang/webdev/actions/runs/11721785765/job/32652333411?pr=2511#step:7:16)     AnalysisDriver._analyzeFileImpl.<anonymous closure> (package:analyzer/src/dart/analysis/driver.dart:1397:11)
<asynchronous suspension>
#[16](https://github.com/dart-lang/webdev/actions/runs/11721785765/job/32652333411?pr=2511#step:7:17)     PerformanceLog.runAsync (package:analyzer/src/dart/analysis/performance_logger.dart:50:14)
<asynchronous suspension>
#[17](https://github.com/dart-lang/webdev/actions/runs/11721785765/job/32652333411?pr=2511#step:7:18)     AnalysisDriver._analyzeFile.<anonymous closure> (package:analyzer/src/dart/analysis/driver.dart:1311:9)
<asynchronous suspension>
#[18](https://github.com/dart-lang/webdev/actions/runs/11721785765/job/32652333411?pr=2511#step:7:19)     OperationPerformanceImpl.runAsync (package:analyzer/src/util/performance/operation_performance.dart:174:14)
<asynchronous suspension>
#[19](https://github.com/dart-lang/webdev/actions/runs/11721785765/job/32652333411?pr=2511#step:7:20)     AnalysisDriver._analyzeFile (package:analyzer/src/dart/analysis/driver.dart:1308:5)
<asynchronous suspension>
#[20](https://github.com/dart-lang/webdev/actions/runs/11721785765/job/32652333411?pr=2511#step:7:21)     AnalysisDriver._produceErrors (package:analyzer/src/dart/analysis/driver.dart:2013:5)
<asynchronous suspension>
#[21](https://github.com/dart-lang/webdev/actions/runs/11721785765/job/32652333411?pr=2511#step:7:22)     AnalysisDriver.performWork (package:analyzer/src/dart/analysis/driver.dart:1248:7)
<asynchronous suspension>
#[22](https://github.com/dart-lang/webdev/actions/runs/11721785765/job/32652333411?pr=2511#step:7:23)     AnalysisDriverScheduler._run (package:analyzer/src/dart/analysis/driver.dart:2442:7)
<asynchronous suspension>
null
An unexpected error was encountered by the Analysis Server.
Please file an issue at https://github.com/dart-lang/sdk/issues/new/choose with the following details:
Internal error: Exception while using a AvoidClassesWithOnlyStaticMembers to visit a ClassDeclarationImpl in CompilationUnitImpl
type 'MethodMember' is not a subtype of type 'ExecutableFragment' in type cast
#0      Interface.map2.<anonymous closure> (package:analyzer/src/dart/element/inheritance_manager3.dart:1290:33)
#1      MapBase.map (dart:collection/maps.dart:82:28)
#2      Interface.map2 (package:analyzer/src/dart/element/inheritance_manager3.dart:1289:16)
#3      _Visitor.visitClassDeclaration (package:linter/src/rules/avoid_classes_with_only_static_members.dart:46:25)
#4      ClassDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:2882:50)
#5      AnalysisRuleVisitor._runSubscriptions (package:analyzer/src/lint/linter_visitor.dart:1086:14)
#6      AnalysisRuleVisitor.visitClassDeclaration (package:analyzer/src/lint/linter_visitor.dart:161:5)
#7      ClassDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:2882:50)
#8      NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:12930:20)
#9      CompilationUnitImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:3555:21)
#10     AnalysisRuleVisitor.visitCompilationUnit (package:analyzer/src/lint/linter_visitor.dart:186:10)
#11     CompilationUnitImpl.accept (package:analyzer/src/dart/ast/ast.dart:3548:50)
#12     LibraryAnalyzer._computeLints (package:analyzer/src/dart/analysis/library_analyzer.dart:410:12)
#13     LibraryAnalyzer._computeDiagnostics (package:analyzer/src/dart/analysis/library_analyzer.dart:334:7)
#14     LibraryAnalyzer.analyze (package:analyzer/src/dart/analysis/library_analyzer.dart:109:5)
#15     AnalysisDriver._analyzeFileImpl.<anonymous closure> (package:analyzer/src/dart/analysis/driver.dart:1397:11)
<asynchronous suspension>
#16     PerformanceLog.runAsync (package:analyzer/src/dart/analysis/performance_logger.dart:50:14)
<asynchronous suspension>
#17     AnalysisDriver._analyzeFile.<anonymous closure> (package:analyzer/src/dart/analysis/driver.dart:1311:9)
<asynchronous suspension>
#18     OperationPerformanceImpl.runAsync (package:analyzer/src/util/performance/operation_performance.dart:174:14)
<asynchronous suspension>
#19     AnalysisDriver._analyzeFile (package:analyzer/src/dart/analysis/driver.dart:1308:5)
<asynchronous suspension>
#20     AnalysisDriver._produceErrors (package:analyzer/src/dart/analysis/driver.dart:2013:5)
<asynchronous suspension>
#21     AnalysisDriver.performWork (package:analyzer/src/dart/analysis/driver.dart:1[24](https://github.com/dart-lang/webdev/actions/runs/11721785765/job/32652333411?pr=2511#step:7:25)8:7)
<asynchronous suspension>
#22     AnalysisDriverScheduler._run (package:analyzer/src/dart/analysis/driver.dart:2442:7)
<asynchronous suspension>
null
@sigurdm
Copy link
Contributor Author

sigurdm commented Nov 7, 2024

Could be a duplicate of #57022 - but I'm not sure.

@dart-github-bot
Copy link
Collaborator

Summary: The analyzer crashes with an internal error when running dart analyze on a specific project using Dart SDK version 3.7.0-99.0.dev. The crash is caused by a type mismatch during analysis, specifically when visiting a class declaration with the AvoidClassesWithOnlyStaticMembers rule.

@dart-github-bot dart-github-bot added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Nov 7, 2024
@bwilkerson
Copy link
Member

@scheglov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants