java.lang.UnsupportedOperationException during C++ projects analysis

Version:

  • SonarQube server 8.7.1.42226 Enterprise edition
  • Build Wrapper for Windows from {SonarQube URL}/static/cpp/build-wrapper-win-x86.zip
  • SonarScanner 4.6.2.2472

What are you trying to achieve:

I am trying to run analysis over C/C++ projects. The build wrapper with build command executes without any error. Directory passed by out-dir parameter is being created and respectively files build-wrapper-dump.json and build-wrapper.log are being created inside it. However, when I try to run SonarScanner for any of these projects runtime error occurs:

INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 1:48.452s
INFO: Final Memory: 124M/428M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.lang.UnsupportedOperationException: /Tpsource\halo\recursion_depth_exception.cpp
        at com.sonar.cpp.analyzer.MsvcDriver.onCapture(MsvcDriver.java:176)
        at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:508)
        at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:358)
        at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:62)
        at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
        at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:389)
        at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:385)
        at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:354)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
        at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:144)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
        at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
        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)

Stack trace remain the same for every project I try to analyse. The only difference is on the source file name for which exception occurs (as files are different between the projects). sonar.cfamily.build-wrapper-output parameter value inside sonar-project.properties file matches one used during build wrapper command execution. For now I try to run analysis manually from Windows Server 2019. Everything has been done according to the documentation: C/C++/Objective-C | SonarQube Docs

Did anyone face similar issue? Does someone have idea what can I check? I am stuck in current situation and will appreciate any help.

Hi @arbdi ,

support for /Tp argument has been fixed by CPP-3096 and it is available in SonarQube 9.0.

If you cannot upgrade SonarQube version you can evaluate to not use /Tp option.

A post was split to a new topic: Error trying to analyze C++ project

A post was merged into an existing topic: Error trying to analyze C++ project

Hi,

SonarQube server has been upgraded to version 9.0 successfully and the problem not longer persist. Thanks a lot for your support.

1 Like

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