Sonar-scanner exception in thread for XCode 12

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension): SonarQue 7.7, SonarSwift 4.1, SonarCFamily 6.1
  • what are you trying to achieve: Scan source code
  • what have you tried so far to achieve this: Looked at different forum posts

After upgrading to XCode 12 I’m starting to get the error:

INFO: ------------------------------------------------------------------------
24-Sep-2020 14:07:52 INFO: EXECUTION FAILURE
24-Sep-2020 14:07:52 INFO: ------------------------------------------------------------------------
24-Sep-2020 14:07:52 INFO: Total time: 3:27.166s
24-Sep-2020 14:07:52 INFO: Final Memory: 114M/2213M
24-Sep-2020 14:07:52 INFO: ------------------------------------------------------------------------
24-Sep-2020 14:07:52 ERROR: Error during SonarQube Scanner execution
24-Sep-2020 14:07:52 java.lang.IllegalStateException: java.lang.IllegalStateException: exit code != 0
24-Sep-2020 14:07:52 at com.sonar.cpp.analyzer.AnalysisExecutor.submit(AnalysisExecutor.java:47)
24-Sep-2020 14:07:52 at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:310)
24-Sep-2020 14:07:52 at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:279)
24-Sep-2020 14:07:52 at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:198)
24-Sep-2020 14:07:52 at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
24-Sep-2020 14:07:52 at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
24-Sep-2020 14:07:52 at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:62)
24-Sep-2020 14:07:52 at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
24-Sep-2020 14:07:52 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
24-Sep-2020 14:07:52 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
24-Sep-2020 14:07:52 at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:359)
24-Sep-2020 14:07:52 at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:354)
24-Sep-2020 14:07:52 at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:317)
24-Sep-2020 14:07:52 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
24-Sep-2020 14:07:52 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
24-Sep-2020 14:07:52 at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:128)
24-Sep-2020 14:07:52 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
24-Sep-2020 14:07:52 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
24-Sep-2020 14:07:52 at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73)
24-Sep-2020 14:07:52 at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
24-Sep-2020 14:07:52 at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
24-Sep-2020 14:07:52 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
24-Sep-2020 14:07:52 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
24-Sep-2020 14:07:52 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
24-Sep-2020 14:07:52 at java.lang.reflect.Method.invoke(Method.java:498)
24-Sep-2020 14:07:52 at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
24-Sep-2020 14:07:52 at com.sun.proxy.$Proxy0.execute(Unknown Source)
24-Sep-2020 14:07:52 at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:185)
24-Sep-2020 14:07:52 at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:137)
24-Sep-2020 14:07:52 at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
24-Sep-2020 14:07:52 at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
24-Sep-2020 14:07:52 at org.sonarsource.scanner.cli.Main.main(Main.java:61)
24-Sep-2020 14:07:52 Caused by: java.lang.IllegalStateException: exit code != 0
24-Sep-2020 14:07:52 at com.sonar.cpp.analyzer.Subprocess.execute(Subprocess.java:54)
24-Sep-2020 14:07:52 at com.sonar.cpp.analyzer.Subprocess.execute(Subprocess.java:25)
24-Sep-2020 14:07:52 at com.sonar.cpp.plugin.CFamilySensor.lambda$process$4(CFamilySensor.java:323)
24-Sep-2020 14:07:52 at com.sonar.cpp.analyzer.AnalysisExecutor.lambda$submit$0(AnalysisExecutor.java:53)
24-Sep-2020 14:07:52 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
24-Sep-2020 14:07:52 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
24-Sep-2020 14:07:52 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
24-Sep-2020 14:07:52 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
24-Sep-2020 14:07:52 at java.lang.Thread.run(Thread.java:745)

I suspect XCode 12 ships with a newer gcc which generates something not expected?

Hi @hzxu,

you are using a very old and unsupported version of SonarQube and SonarCFamily. You should use at least LTS version 7.9.X or non LTS version 8.4, many bugs have been fixed in the mean time.

Thanks!