SonarQube Server 2025.5 Developer Edition
(Deployed on a Linux host via Docker: 2025.5.0-developer)
-
CFamily version: 6.72.0.89435
-
Build-wrapper: 6.72
-
Sonar-scanner: 7.3.0.5189
Project Environment:
-
VM with Windows 10, MSBuild + MSVC/Visual Studio 2019, C++17
.slnsolution -
Also tested with a Windows Server Core 2022 Docker container (same toolset as the VM)
-
GitLab + GitLab Runner 17.11
Hello everyone,
After upgrading our SonarQube instance to version 2025.5, along with the build-wrapper and sonar-scanner, the scanner now systematically fails with one of our company’s projects:
18:32:29.155 ERROR Exception in thread thread-1
com.sonar.cpp.analyzer.Analyzer$AnalyzerException: Exit code -2147483645: D:/GitLab-Runner/builds/path/to/project/Activate/Activate.cpp
at com.sonar.cpp.analyzer.AnalysisHandler.acceptResult(AnalysisHandler.java:77)
at com.sonar.cpp.analyzer.Subprocess.executeImpl(Subprocess.java:127)
at com.sonar.cpp.analyzer.Subprocess.execute(Subprocess.java:159)
at com.sonar.cpp.plugin.CFamilySensor.lambda$process$16(CFamilySensor.java:917)
at com.sonar.cpp.analyzer.AnalysisExecutor.lambda$submit$0(AnalysisExecutor.java:59)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
18:32:29.155 ERROR Exception in thread thread-7
com.sonar.cpp.analyzer.Analyzer$AnalyzerException: Exit code -2147483645: D:/GitLab-Runner/builds/path/to/project/ApplicationDll/ParametersCommon.cpp
at com.sonar.cpp.analyzer.AnalysisHandler.acceptResult(AnalysisHandler.java:77)
at com.sonar.cpp.analyzer.Subprocess.executeImpl(Subprocess.java:127)
at com.sonar.cpp.analyzer.Subprocess.execute(Subprocess.java:159)
at com.sonar.cpp.plugin.CFamilySensor.lambda$process$16(CFamilySensor.java:917)
at com.sonar.cpp.analyzer.AnalysisExecutor.lambda$submit$0(AnalysisExecutor.java:59)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
# ...
18:32:30.492 ERROR Exception in thread thread-3
com.sonar.cpp.analyzer.Analyzer$AnalyzerException: Exit code -2147483645: D:/GitLab-Runner/builds/path/to/project/LibraryName/Constants.cpp
at com.sonar.cpp.analyzer.AnalysisHandler.acceptResult(AnalysisHandler.java:77)
at com.sonar.cpp.analyzer.Subprocess.executeImpl(Subprocess.java:127)
at com.sonar.cpp.analyzer.Subprocess.execute(Subprocess.java:159)
at com.sonar.cpp.plugin.CFamilySensor.lambda$process$16(CFamilySensor.java:917)
at com.sonar.cpp.analyzer.AnalysisExecutor.lambda$submit$0(AnalysisExecutor.java:59)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
18:32:32.240 INFO [7/323] Finished analyzing: D:/GitLab-Runner/builds/path/to/project/LibraryName/MatrixMethods.cpp (4158ms)
18:32:32.242 ERROR
An error occurred while analyzing the following compilation unit:
D:/GitLab-Runner/builds/path/to/project/Application/Activate.cpp
A file named "sonar-cfamily-reproducer.tar.xz" has been generated to help the problem investigation.
Please contact SonarSource support providing the following file to help improving the analyzer:
D:\GitLab-Runner\builds\path\to\project\sonar-cfamily-reproducer.tar.xz
18:32:56.260 ERROR Error during SonarScanner Engine execution
java.lang.IllegalStateException:
An error occurred while analyzing the following compilation unit:
D:/GitLab-Runner/builds/path/to/project/Application/Activate.cpp
A file named "sonar-cfamily-reproducer.tar.xz" has been generated to help the problem investigation.
Please contact SonarSource support providing the following file to help improving the analyzer:
D:\GitLab-Runner\builds\path\to\project\sonar-cfamily-reproducer.tar.xz
at com.sonar.cpp.plugin.CFamilySensor.logReproducerGeneration(CFamilySensor.java:956)
at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:271)
at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:199)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:69)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:64)
at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:80)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:227)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:206)
at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:212)
at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:208)
at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:178)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:227)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:206)
at org.sonar.scanner.bootstrap.SpringScannerContainer.doAfterStart(SpringScannerContainer.java:339)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:227)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:206)
at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:142)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:227)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:206)
at org.sonar.scanner.bootstrap.ScannerMain.runScannerEngine(ScannerMain.java:157)
at org.sonar.scanner.bootstrap.ScannerMain.run(ScannerMain.java:72)
at org.sonar.scanner.bootstrap.ScannerMain.main(ScannerMain.java:56)
18:32:56.362 INFO EXECUTION FAILURE
18:32:56.366 INFO Total time: 1:06.527s
The files the scanner is failing on are not consistent.
It was working fine with 2025.3. Scan does succeed with Autoconfig but the scanner itself recommends not using it:
04:50:30.295 WARN C and C++ AutoConfig is discouraged for this project. Consider setting the properties in `Project Administration > General Settings > C / C++ / Objective-C > AutoConfig Settings`. Otherwise, please switch to Compilation Database based analysis for better analysis quality.
Even after setting the recommended properties, the scanner still misses nearly 40% of the issues compared to the build-wrapper output.
After some research on this forum, I found that someone had encountered a similar issue a year ago:
https://community.sonarsource.com/t/exception-seen-com-sonar-cpp-analyzer-analyzer-analyzerexception-with-new-cfamily-version/117473
That error appeared to be fixed shortly after in CFamily v6.57:
https://sonarsource.atlassian.net/browse/CPP-5415
However, it seems to be happening again on our side with CFamily version 6.72.0.89435 and SonarQube 2025.5.
The issue appears to be the same: the analysis works again as soon as I disable PCH generation by adding the following property to all our .vcxproj files:
<PrecompiledHeader>NotUsing</PrecompiledHeader>
Thanks to this workaround, the analysis now completes successfully. However, disabling PCH has significantly impacted our build times:
-
11 minutes without build-wrapper
-
25 minutes with build-wrapper
-
55 minutes with build-wrapper and PCH disabled
If someone from the Sonar team would like to see a reproducer, I can provide one. I also tried reaching out to some of our contacts at Sonar with all this information a few weeks ago, but I believe the email may have been missed.