Sonar scanner issues with Xcode16

Using latest scanner version 6.1.0.4477

Hello, we’ve recently updated to Xcode16 and found a couple issues with sonar scanner in our CI pipeline.

First we encountered an issue with several objective-c files analysis

09:13:00.404 ERROR Error during SonarScanner Engine execution

java. lang. IllegalStateException:

An error occurred while analyzing the following compilation unit:

/path/to/some/objectivecfile.m

A file named "sonar-family-reproducer.tar.xz" has been generated to help the problem investigation.

Please contact SonarSource support providing the following file to help improving the analyzer:

/Users/vagrant/git/sonar-family-reproducer.tar.xz

To solve that we had to exclude a good amount of obj-c files from the analysis, seemingly this was quite random since the rest of obj-c files in our codebase were analysed just fine. This is a suboptimal solution so it would be great to know if there’s another fix for this

Second, the scanner execution time has gone up from around 2 mins to around 12, with some files taking up to 10 seconds, where before this was in the milliseconds range.

Also we’ve noticed an odd log that may help in debugging, apparently Xcode16 is an unknown compiler, this was working fine with Xcode15.

09:11:46.445 INFO Ignore unknown compiler: builtin-ScanDependencies -o /Users/vagrant/Library/Developer/Xcode/DerivedData/path/to/file.o.scan -- /Applications/Xcode-16.0.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -ivfsstatcache ...

Hi @ToniRealp and thanks for sharing the problem with us,

In order to help us understand the problem, would you be willing to provide the following information?

  1. The files from the build-wrapper output directory (compile_commands.json, build-wrapper-dump.json, and build-wrapper.log)
  2. In case you are not using build-wrapper, the compilation database file you are using and how you are generating it.
  3. One of the generated “sonar-family-reproducer.tar.xz” files

I can open a private thread with you if you prefer to share this information privately.

Thanks in advance,

Best regards,
Michael

Hi Michael, thanks for getting back to me!
I would greatly appreciate if you could open a private thread, we can post the findings back if we manage to find a solution

We’re seeing what appears to be the same issue with Xcode 16.0 and SonarScanner 6.2.1.4610. Is this a known issue and/or is there a workaround?

An error occurred while analyzing the following compilation unit: 
  /path/to/MyObjCFile.m
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:
  …/sonar-cfamily-reproducer.tar.xz

	at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:270)
	at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:183)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:63)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:75)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:51)
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:64)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:192)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:188)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:159)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
	at org.sonar.scanner.bootstrap.ScannerContainer.doAfterStart(ScannerContainer.java:416)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:128)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
	at org.sonar.scanner.bootstrap.ScannerMain.runScannerEngine(ScannerMain.java:135)
	at org.sonar.scanner.bootstrap.ScannerMain.run(ScannerMain.java:52)
	at org.sonar.scanner.bootstrap.ScannerMain.main(ScannerMain.java:38)

Hi @justintyre,

The issue is still under investigation unfortunately. In order to help advance the investigation further, would you be willing to share the generated sonar-cfamily-reproducer.tar.xz file?

I can also start a thread with you if you prefer to share the file privately.

Best regards,
Michael

Thank you all for reporting the issue and sharing the information. We are currently investigating the issue in [CPP-5815] - Jira.

Hello,

Thanks for the feedback. I am happy to share that the issue was fixed in CFamily version 6.61. This is now live on SonarQube Cloud (since a couple of weeks actually), and also available in SonarQube Server version 10.8.

If you have excluded any files because of this crash, it should be possible to include them again in the analysis. Let us know if you encounter any further issues. Any feedback is always appreciated!

Best regards,
Michael

1 Like