Error during analysis of C/C++ code

Must-share information (formatted with Markdown):

  • which versions are you using: SonarQube 9.9.3
  • how is SonarQube deployed: On a K8s instance
  • what are you trying to achieve: Perform an analysis of my codebase
  • what have you tried so far to achieve this: We have it running on an older version of our OS but it fails with the latest version. The error message does not really help me in determining what the problem is.
INFO: Cache is explicitly disabled: sonar.cfamily.cache.enabled=false

[644](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L644)INFO: ------------------------------------------------------------------------

[645](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L645)INFO: EXECUTION FAILURE

[646](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L646)INFO: ------------------------------------------------------------------------

[647](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L647)INFO: Total time: 2:05.148s

[648](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L648)INFO: Final Memory: 161M/1640M

[649](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L649)INFO: ------------------------------------------------------------------------

[650](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L650)ERROR: Error during SonarScanner execution

[651](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L651)java.lang.NullPointerException

[652](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L652) at com.sonar.cpp.analyzer.StdFlags.fromCppMacrosWithoutConditionalFeatures(StdFlags.java:34)

[653](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L653) at com.sonar.cpp.analyzer.QccDriver.onCapture(QccDriver.java:172)

[654](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L654) at com.sonar.cpp.analyzer.CompilerDrivers.onCapture(CompilerDrivers.java:34)

[655](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L655) at com.sonar.cpp.plugin.CFamilySensor.lambda$process$17(CFamilySensor.java:908)

[656](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L656) at com.sonar.cpp.plugin.BuildWrapperJsonReader.readCaptures(BuildWrapperJsonReader.java:86)

[657](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L657) at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:905)

[658](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L658) at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:410)

[659](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L659) at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:215)

[660](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L660) at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)

[661](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L661) at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88)

[662](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L662) at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:64)

[663](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L663) at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:82)

[664](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L664) at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)

[665](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L665) at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)

[666](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L666) at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:403)

[667](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L667) at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:399)

[668](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L668) at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:368)

[669](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L669) at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)

[670](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L670) at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)

[671](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L671) at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:137)

[672](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L672) at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)

[673](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L673) at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)

[674](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L674) at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)

[675](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L675) at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)

[676](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L676) at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)

[677](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L677) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

[678](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L678) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

[679](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L679) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

[680](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L680) at java.base/java.lang.reflect.Method.invoke(Unknown Source)

[681](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L681) at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)

[682](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L682) at com.sun.proxy.$Proxy0.execute(Unknown Source)

[683](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L683) at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)

[684](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L684) at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)

[685](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L685) at org.sonarsource.scanner.cli.Main.execute(Main.java:112)

[686](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L686) at org.sonarsource.scanner.cli.Main.execute(Main.java:75)

[687](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L687) at org.sonarsource.scanner.cli.Main.main(Main.java:61)

[688](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L688)ERROR:

[689](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L689)ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

[691](https://gitlab.prod.sgre.one/wp-tuc/SICS/SICS/-/jobs/4211928#L691)Cleaning up project directory and file based variables

As usual the call stack isn’t of much help to me. Could you consider translating it into something useful instead?

Hi,

Can you share the full analysis log, as well as the build-wrapper-dump.json, please?

 
Thx,
Ann

Hi. I can send you those but I prefer to not do so publicly. How can I reach you?

Hi @kkroier ,

I sent you a private message where you can share the logs privately.

Hi. Thanks for the reply. It turned out we were using two different compiler versions during the compilation and analysis steps. Aligning them solved the problem.

Best regards
Kristian

2 Likes

Hi @kkroier ,

thank you for sharing and glad that you managed to spot the difference.