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

AD0001: ArgumentNullException in SymbolicExecutionRunner #9113

Closed
martin-strecker-sonarsource opened this issue Apr 17, 2024 · 0 comments · Fixed by #9120
Closed

AD0001: ArgumentNullException in SymbolicExecutionRunner #9113

martin-strecker-sonarsource opened this issue Apr 17, 2024 · 0 comments · Fixed by #9120
Assignees
Labels
Area: C# C# rules related issues. Area: CFG/SE CFG and SE related issues. Area: VB.NET VB.NET rules related issues. Sprint: Hardening Fix FPs/FNs/improvements Type: Bug Exceptions and blocking issues during analysis.
Projects
Milestone

Comments

@martin-strecker-sonarsource
Copy link
Contributor

For .NET reference assemblies, we see AD0001 that look like so:

CSC : warning AD0001: Analyzer 'SonarAnalyzer.Rules.CSharp.SymbolicExecutionRunner' threw an exception of type
 'SonarAnalyzer.SymbolicExecution.SymbolicExecutionException' with message 'Error processing method: get_Item
## Method file: C:\sonar-ci\Project\src\libraries\System.Collections.Immutable\ref\System.Collections.Immutable.cs
## Method line: 917,35 
## Inner exception: System.ArgumentNullException: Value cannot be null. (Parameter 'type')
##    at SonarAnalyzer.SymbolicExecution.Roslyn.ExceptionState..ctor(ITypeSymbol type)
##    at SonarAnalyzer.SymbolicExecution.Roslyn.RoslynSymbolicExecution.ThrownException(ExplodedNode node, ControlFlowBranchSemantics semantics)
##    at SonarAnalyzer.SymbolicExecution.Roslyn.RoslynSymbolicExecution.ProcessBranching(ExplodedNode node)+MoveNext() ##    at SonarAnalyzer.SymbolicExecution.Roslyn.RoslynSymbolicExecution.Execute()
##    at SonarAnalyzer.Rules.SymbolicExecutionRunnerBase.AnalyzeRoslyn(SonarAnalysisContext analysisContext, SonarSyntaxNodeReportingContext nodeContext, ISymbol symbol)'. 
[C:\sonar-ci\Project\src\libraries\System.Collections.Immutable\ref\System.Collections.Immutable.csproj]

Source: https://api.cirrus-ci.com/v1/task/6240477526097920/logs/build.log

The files in questions are the reference assemblies like this one:

https://github.com/dotnet/runtime/blob/main/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.cs#L18

A possible root cause is throw null where null does not have a type, and therefore, ITypeSymbol is null.

@martin-strecker-sonarsource martin-strecker-sonarsource added Type: Bug Exceptions and blocking issues during analysis. Area: C# C# rules related issues. labels Apr 17, 2024
@CristianAmbrosini CristianAmbrosini added the Sprint: Hardening Fix FPs/FNs/improvements label Apr 17, 2024
@CristianAmbrosini CristianAmbrosini added this to To do in Best Kanban Apr 17, 2024
@CristianAmbrosini CristianAmbrosini added this to the 9.24 milestone Apr 17, 2024
@CristianAmbrosini CristianAmbrosini moved this from To do to In progress in Best Kanban Apr 17, 2024
@github-actions github-actions bot moved this from In progress to Review in progress in Best Kanban Apr 17, 2024
Best Kanban automation moved this from Review in progress to Validate Peach Apr 17, 2024
@Tim-Pohlmann Tim-Pohlmann added Area: CFG/SE CFG and SE related issues. Area: VB.NET VB.NET rules related issues. labels Apr 17, 2024
@CristianAmbrosini CristianAmbrosini moved this from Validate Peach to Done in Best Kanban Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: C# C# rules related issues. Area: CFG/SE CFG and SE related issues. Area: VB.NET VB.NET rules related issues. Sprint: Hardening Fix FPs/FNs/improvements Type: Bug Exceptions and blocking issues during analysis.
Projects
Best Kanban
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants