Crash (java.lang.Thread.run(Unknown Source)) during C++ analysis

Hi,

We have a mixed repository with C# and C++ code on a windows server VM, the sonarscan exits with an error.

what is the current environment:
OS: Windows Server 2016
Compile tool: Visual Studio 2017, .Net 4.7.2, C++ toolset 141

SonarCFamily
Code Analyzer for C, C++, Objective-C
6.5.0 (build 12222)installed

we we use commercial version of Sonarqube version Version 7.9.1

Scanner: sonar-scanner-4.2.0.1873
Scanner for MSBuild: SonarQube.Scanner.MSBuild.exe
build-wrapper-win-x86-64.exe

Start script:
SonarScanner.MSBuild.exe begin /k:“hsd_sonar_cbv8” /n:“Sonar CBV8” /v:“0” /d:sonar.cfamily.build-wrapper-output=bw_output /d:sonar.cfamily.threads=5 /d:sonar.verbose=true
build-wrapper-win-x86-64.exe --out-dir bw_output msbuild /nodeReuse:false /maxcpucount:1 /detailedsummary /fl1 /fl2 /fl3 /flp1:logfile=msbuild.log /flp2:logfile=msbuild-errors.log;errorsonly /flp3:logfile=msbuild-warnings.log;warningsonly %target% %MSBUILDFILE%
SonarScanner.MSBuild.exe end

the Build goes great, its the scanner that eventually crashes:

10:36:03.443 ERROR: Exception in thread pool-3-thread-4
java.lang.IllegalStateException: exit code != 0
at com.sonar.cpp.analyzer.Subprocess.execute(Subprocess.java:55)
at com.sonar.cpp.analyzer.Subprocess.execute(Subprocess.java:26)
at com.sonar.cpp.plugin.CFamilySensor.lambda$process$4(CFamilySensor.java:380)
at com.sonar.cpp.analyzer.AnalysisExecutor.lambda$submit$0(AnalysisExecutor.java:53)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

After I delete the cpp files That I think are causing this issue, the Scan will run through.
But I didn’t debug throught these list of FilesTonalyze.txt which file is the culprit.

Name

.sonarqube\out\44\FilesToAnalyze.txt
.sonarqube\out\45\FilesToAnalyze.txt
.sonarqube\out\46\FilesToAnalyze.txt
.sonarqube\out\47\FilesToAnalyze.txt
.sonarqube\out\48\FilesToAnalyze.txt
.sonarqube\out\49\FilesToAnalyze.txt
.sonarqube\out\50\FilesToAnalyze.txt
.sonarqube\out\51\FilesToAnalyze.txt
.sonarqube\out\52\FilesToAnalyze.txt
.sonarqube\out\53\FilesToAnalyze.txt
.sonarqube\out\54\FilesToAnalyze.txt
.sonarqube\out\55\FilesToAnalyze.txt
.sonarqube\out\56\FilesToAnalyze.txt
.sonarqube\out\58\FilesToAnalyze.txt
.sonarqube\out\62\FilesToAnalyze.txt
.sonarqube\out\63\FilesToAnalyze.txt
.sonarqube\out\64\FilesToAnalyze.txt
.sonarqube\out\67\FilesToAnalyze.txt
.sonarqube\out\69\FilesToAnalyze.txt
.sonarqube\out\70\FilesToAnalyze.txt
.sonarqube\out\71\FilesToAnalyze.txt
.sonarqube\out\72\FilesToAnalyze.txt

After Deleting
.sonarqube\out\48

the SonarScan went through…57 lines in that file

Hi @Ed_Die,

could you please update SonarCFamily to its latest version 6.6 and rerun the analysis on a clean project without deleting any file?

Yes That worked! :slight_smile:
but also need to update the wraper msbuild .exe

Hi @Ed_Die,

great, then I’ll consider this topic closed.