AnalyzerException in C++ Project

I get an AnalyzerException when analyzing a C++ project with SonarScanner and SonarCloud, which I build with Jenkins and Conan.
The compilation unit which causes the exception has a dependency on microsoft/cpprestsdk.

versions used:
sonar-scanner-4.4.0.2170-linux
gcc 10.2
Ubuntu 20.10

error observed:

An error occurred while analyzing the following compilation unit: 
  /var/lib/jenkins/workspace/TradingUi_feature_hk-412-rest/src/client/RestClientMs.cpp
A file named "sonar-cfamily-reproducer.zip" has been generated to help the problem investigation.
Please contact SonarSource support providing the following file to help improving the analyzer:
  /var/lib/jenkins/workspace/TradingUi_feature_hk-412-rest/sonar-cfamily-reproducer.zip

INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 27.103s
INFO: Final Memory: 25M/108M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: 
An error occurred while analyzing the following compilation unit: 
  /var/lib/jenkins/workspace/TradingUi_feature_hk-412-rest/src/client/RestClientMs.cpp
A file named "sonar-cfamily-reproducer.zip" has been generated to help the problem investigation.
Please contact SonarSource support providing the following file to help improving the analyzer:
  /var/lib/jenkins/workspace/TradingUi_feature_hk-412-rest/sonar-cfamily-reproducer.zip

	at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:390)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:45)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:75)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:51)
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:68)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:444)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:440)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:398)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:126)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:58)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:52)
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at com.sun.proxy.$Proxy0.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
ERROR: 
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

I can send the reproducer.zip file.
Thank you.

1 Like

Hi @Patryk ,

I sent you a PM where you can share the reproducer file.

1 Like

A post was split to a new topic: cpp.analyzer.Analyzer$AnalyzerException: Exit code != 0

Hi @Patryk,

sorry for the delay. You are facing CPP-2696, you can avoid it by defining BOOST_ASIO_DISABLE_NOEXCEPT in your build.

It works, Thanks a lot!

1 Like

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