Skip to content

NET-3543 Fix AD0001: SonarAnalyzer.Rules.CSharp.SymbolicExecutionRunner exception when analyzing pull request on github. #9800

Closed

Description

@AraHaan

Description

When this Pull Request got run on the current commit in it, the analyzer started throwing exceptions for specific C# code files due to a a nullref caused by some sort of issue somewhere in the analyzer's code (seems to always trip up on MethodDeclarationSyntax).

Reproducer

The code in this pull request can reproduce the exception without problems: Elskom/IDisposableGenerator#48

Product and Version

The latest NuGet analyzer, but also reproduces inside of the Visual Studio extension.

Activity

  1. AraHaan commented on Mar 31, 2026

    @AraHaan
    Author

    cc: @pavel-mikula-sonarsource

    Please help me figure out a way to fix this type of problem with the analyzer so that way other people with similar code can still use the analyzer.

  2. mary-georgiou commented on Apr 1, 2026

    @mary-georgiou
    Contributor

    Hello @AraHaan .
    Could you please provide us with a minimal code reproducer for this issue?
    Or if possible give us the logs where the AD0001 happens?

  3. self-assigned this
    on Apr 1, 2026
  4. AraHaan commented on Apr 1, 2026

    @AraHaan
    Author

    Seems to also happen with files in this PR as well: https://github.com/Elskom/IDisposableGenerator/pull/53/changes

  5. mary-georgiou commented on Apr 2, 2026

    @mary-georgiou
    Contributor

    @AraHaan one question:
    You mention that you are using latest NuGet - latest NuGet does not have SE.
    If you do probably you are on an old one - and even if this is fixed you won't have the fix (if not fixed already - we're investigating with @pavel-mikula-sonarsource ).
    Maybe you are getting the error via connected mode in your IDE?
    Or the analysis in your PR uses SonarQube Server Dev+ versions or SonarQube Cloud?

  6. added
    BugExceptions and blocking issues during analysis.
    on Apr 2, 2026
  7. changed the title [-]Fix AD0001: SonarAnalyzer.Rules.CSharp.SymbolicExecutionRunner exception when analyzing pull request on github.[/-] [+]NET-3543 Fix AD0001: SonarAnalyzer.Rules.CSharp.SymbolicExecutionRunner exception when analyzing pull request on github.[/+] on Apr 2, 2026
  8. github-actions commented on Apr 2, 2026

    @github-actions
    Contributor

    Internal ticket NET-3543

  9. AraHaan commented on Apr 2, 2026

    @AraHaan
    Author

    Or the analysis in your PR uses SonarQube Server Dev+ versions or SonarQube Cloud?

    I think the "Security Code Scan" action from codacy could be using an outdated SonarAnalyzer version for C# (or outdated SonarQube?) (idk its version) and then it might be publishing the AD0001's on its upload to GitHub's CodeQL step (https://github.com/codacy/codacy-analysis-cli-action specifically).

    I guess I could look into seeing if they could update the analyzer as well.

  10. AraHaan commented on Apr 2, 2026

    @AraHaan
    Author

    And filed issue to them as well.

  11. mary-georgiou commented on Apr 2, 2026

    @mary-georgiou
    Contributor

    FYI Symbolic Execution since sonar-dotnet 10.0.0 is only available for SonarQube Cloud and SonarQube Team/Develope, Enterprise and Data Center Editions.
    it's also not available via the NuGet anymore - so if you have the NuGet updated the issue will be removed because SE won't be running anyways.

  12. pavel-mikula-sonarsource commented on Apr 2, 2026

    @pavel-mikula-sonarsource
    Contributor

    Hi,
    regarding your request to them to update to the latest - please be aware that 10.2 is the latest version that they can update to, without violating license of the package.

    From version 10.3 onwards, the license has changed to SSALv1: https://www.sonarsource.com/license/ssal/

  13. pavel-mikula-sonarsource commented on Apr 2, 2026

    @pavel-mikula-sonarsource
    Contributor

    Cross reference: #8811 was the previous topic where we tried to reproduce this.

    @mary-georgiou-sonarsource The fact that it reproduces itself in Codacy explains that there's a custom compilation object, which can possibly contain SyntaxTreeOptions with null value and your reproducer makes sense.

    @AraHaan Once we fix this, the fix will reach you only via SonarQube Cloud, or next release of SonarQube Server, or SonarQube for IDE in connected mode connected to one of those. We won't backport it to the older versions, unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugExceptions and blocking issues during analysis.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions