Sonar-scanner crashed on a c-file on OSX

Hi,

Since upgrading to SonarQube 7.5 or 7.6 from 7.4 (developer editions), sonar scanner 3.3.0.1492 crashes on analyzing c files on OSX (High Sierra 10.13.6).

My issue is very similar to: Sonar-scanner crashed on a c-file

However, ‘sysctl -w vm.max_map_count=262144’ and ‘sysctl -w fs.file-max=65536’ doesn’t work on OSX (i.e sysctl: unknown oid ‘vm.max_map_count’).

INFO: SonarQybve Scanner 3.3.0.1492
INFO: Java 1.8.0_121 Oracle Corporation (64-bit)
INFO: Max OS X 10.13.6 x86_64
INFO: SONAR_SCANNER_OPTS=-Xmx1024m
INFO: Sonarqube server 7.6.0
...
INFO: Sensor CFamily [cpp]
INFO: Using build-wrapper output: …
INFO: Available processors: 16
INFO: Using 1 thread for analysis according to value of “sonar.cfamily.threads” property 
WARN: Metric ‘comment_lines_data’ is depurated. Provided value is ignored
INFO: [pool-2-thread-1] …file.c
ERROR: Exception in thread pool-2-thread-1
java.lang.IllegalStateException: exit code != 0
	at com.sonar.cpp.N.E.A(na:869)
	at com.sonar.cpp.N.E.A(na:444)
	at com.sonar.cpp.plugin.R.A(na:2250)
	at com.sonar.cpp.N.F.B(na:50)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

Same setup works fine when using SonarQube 7.4 using sonar scanner 3.2.0.1227 (sonar scanner is successful). The problem started in 7.5 and is still present in 7.6.

Cheers,

Dave

Hi @dave,

SonarQube 7.5 ships with a new C/C++/Objective-C analyzer, that’s why you are now facing such issue.
In order to help you could you please share a bit more of the log you posted? In particular the full line below.

INFO: [pool-2-thread-1] …file.c

I would then need you to try to create a reproducer for such failure, you would need to run the analysis specifying the following property:

sonar.cfamily.reproducer=/copy/paste/the/exact/full/path/from/failing/analysis/of/file.c

After that you should find a file called sonar-cfamily.reproducer in the project folder and you should share it with me privately if it is not open-source code.

Hi @mpaladin,

I added the sonar.cfamily.reproducer line, after rerunning the job I see in the log:

ERROR:
ERROR: Please contact SonarSource Support and provide file .../sonar-cfamily.reproducer
ERROR:

This appears right before the INFO: [pool-2-thread-1] log line.
However, I don’t see the file where it says it should be. I searched through the entire project folder and its not there?

By the way: I’m running all this on Jenkins.

Cheers,

Dave

Hi @dave,

if the reproducer has not been created would you be able to try to create a minimalistic reproducer project to help us with the investigation?

It would also be helpful if you could send me privately the full sonar-scanner log and the build-wrapper-dump.json file.

Hi @mpaladin

What would cause the reproducer file to not be created?

Sure, i’ll try and help. Are you suggesting that I try to create a separate test project to reproduce the error?

Cheers,

Dave

the scanner log and build-wrapper-dump.json files might help me to understand.

if you would be able to create a minimal reproducing project that you could archive and share with me that would be great.