Sonar-scanner crashes while analyzing C++ file

We’re using xcodebuild to create a compile_commands.json and feed that into sonar scanner.

➜ sonar-scanner --version
INFO: Scanner configuration file: /opt/homebrew/Cellar/sonar-scanner/5.0.0.2966/libexec/conf/sonar-scanner.properties
INFO: Project root configuration file: /Users/picard/vastlimits/uberAgent/sonar-project.properties
INFO: SonarScanner 5.0.0.2966
INFO: Java 20.0.1 Homebrew (64-bit)
INFO: Mac OS X 13.5 aarch64

Also tested with the binary download from the website and the result is the same.

On an old Intel Mac the scanner finished successfully once, but crashes ever since. Where can I send the created sonar-cfamily-reproducer.zip to?
I noticed that the reproducer contains the source code, which of course I can’t share. What option do we have here? Log files?

Hi Winfried,

Thanks for reaching out. Yes, as a first step, it would be helpful to check the full log produced by sonar-scanner. Please also pass the -X command-line flag to enable extended debug output.

I’ll send you a direct message such that you can share the log file with us.

Best,
Philipp

Thanks for your reply. I found the issue. I’m using Xcode for a C++ project and thus needed to create the compile_commands.json first. When I try to run the scanner immediately after creating the compile_commands.json it crashes. If I trigger another build w/o the specific compiler flags it works w/o crashing.
Might be worth documenting this problem somewhere in the scanner documentation.

Excellent. I’m glad that it works now.

And thanks for reporting your fix.

Best,
Philipp

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.