Sonarscanner-msbuild c++ crash

Using SonarQube Developer Edition version: 8.5 (build 37579), sonar-scanner-msbuild 4.4.0.2170

Hello
When scanning a c++ project with sonar-scanner-msbuild we get a crash on a file (everything works fine without that file).

This is our command line but it doesn’t matter if we use multithreading support or cache

“C:\sonar-scanner-msbuild\SonarScanner.MSBuild.exe” begin /k:“xxx:yyy” /n:“xxx-yyy” /d:sonar.cfamily.cache.enabled=true /d:sonar.cfamily.cache.path=sonar_build_cache /d:sonar.cfamily.build-wrapper-output=sonar_build_wrapper /d:sonar.exclusions=“lot of exclusions” /d:sonar.cpd.exclusions=“lot of exclusions” /d:sonar.cfamily.threads=7 /d:sonar.verbose=true
C:\sonar_build_wrapper\build-wrapper-win-x86-64.exe --out-dir sonar_build_wrapper “C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe” “YYY.sln” /t:Rebuild /p:Configuration=Release;Platform=x64 /m
“C:\sonar-scanner-msbuild\SonarScanner.MSBuild.exe” end

This is the output:
10:56:01.343 ERROR:
An error occurred while analyzing the following compilation unit:
C:/Jenkins/workspace/xxxx/src/xx/xx.cpp
A file named “sonar-cfamily.reproducer” has been generated to help the problem investigation.
Please contact SonarSource support providing the following file to help improving the analyzer:
C:\Jenkins\workspace\xxxx\src\sonar-cfamily.reproducer

10:56:02.851 INFO: ------------------------------------------------------------------------
10:56:02.851 INFO: EXECUTION FAILURE
10:56:02.851 INFO: ------------------------------------------------------------------------
10:56:02.853 INFO: Total time: 9:11.339s
10:56:06.030 ERROR: Error during SonarScanner execution
10:56:06.030 INFO: Final Memory: 24M/414M
10:56:06.030 INFO: ------------------------------------------------------------------------
java.lang.IllegalStateException:
An error occurred while analyzing the following compilation unit:
C:/Jenkins/workspace/xxxx/src/xx/xx.cpp
A file named “sonar-cfamily.reproducer” has been generated to help the problem investigation.
Please contact SonarSource support providing the following file to help improving the analyzer:
C:\Jenkins\workspace\xxxx\src\sonar-cfamily.reproducer

    at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:369)
    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:393)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:389)
    at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:358)
    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 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    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)

Process returned exit code 1
The SonarScanner did not complete successfully
10:56:06.396 Post-processing failed. Exit code: 1

Hi @jggundin,

would you be able to share such file? I can send you a PM if you want to share privately.

Ok, no problem to send the file to SonarSource support.

Thanks!

Hi @jggundin,

if you have a support plan feel free to use paid support channel otherwise you can share it in this topic or I can send you a private message where you can share privately.

Please send me a PM to be able to share it privately.

Thanks!

Hi @jggundin,

PM sent.