AD0001: CbdeHandlerRule: Object reference not set to an instance of an object

When running the sonar analyses in the our build pipe line we get:

Warning AD0001: Analyzer 'SonarAnalyzer.Rules.CSharp.CbdeHandlerRule' threw an exception of type 'SonarAnalyzer.CBDE.CbdeException' with message 'Top level error in CBDE handling: Object reference not set to an instance of an object.
## Details: 
## Inner exception: 
## Stack trace:    at SonarAnalyzer.CBDE.MlirExporter.MlirType(ITypeSymbol csType)
##    at SonarAnalyzer.CBDE.MlirExporter.MlirType(ExpressionSyntax e)
##    at SonarAnalyzer.CBDE.MlirExporter.ComputeCompatibleId(ExpressionSyntax op, String resultType)
##    at SonarAnalyzer.CBDE.MlirExporter.ExportReturnStatement(ReturnStatementSyntax ret, String functionReturnType)
##    at SonarAnalyzer.CBDE.MlirExporter.ExportBlock(Block block, MethodDeclarationSyntax parentMethod, String functionReturnType)
##    at SonarAnalyzer.CBDE.MlirExporter.ExportFunction(MethodDeclarationSyntax method)
##    at SonarAnalyzer.CBDE.CbdeHandler.ExportFunctionMlir(SyntaxTree tree, SemanticModel model, MlirExporterMetrics exporterMetrics, String mlirFileName)
##    at SonarAnalyzer.CBDE.CbdeHandler.<>c__DisplayClass25_0.<RegisterMlirAndCbdeInOneStep>b__0(CompilationAnalysisContext c)'.

I get it only from one of 15 projects.
I don’t get it when compiling on my local PC.

Where could I look for the cause of this problem?

SonarQube Version 8.9.9 (build 1)
SonarScanner for MSBuild 5.5.3
Csharp Plutin version 8.22.0.31243

Hi @eos_gortor,

Could you please check if the rule S3949 is enabled on the active profile? The error seems to be caused by it and you can work around this problem by disabling the rule.

We do plan to fix the issue but I cannot provide an ETA at this point.

Thanks,
Costin

Disabling the rule worked. Thank you.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.