Ericsson / codechecker

CodeChecker is an analyzer tooling, defect database and viewer extension for the Clang Static Analyzer and Clang Tidy
https://codechecker.readthedocs.io
Apache License 2.0
2.26k stars 379 forks source link

Missing key 'extended_message' in Clang SA plist report (Sonar) #3601

Open aallrd opened 2 years ago

aallrd commented 2 years ago

Hello,

This is going to be a weird issue, because everything works wonderfully well, thank you for CodeChecker šŸ‘

I am using CodeChecker 6.18.0 on my codeline to run the Clang SA, and I am successfully able to analyze/parse/store the generated report on our CodeChecker server. Some people in my organization are running a SonarQube instance and wanted to experiment if we could push the CodeChecker reports to the Sonar server. Since the CodeChecker analyze output is in the plist format, it seemed like a straightforward task but we got this error when processing the files with Sonar:

The 'Clang Static Analyzer' report is invalid, report='test.cpp_clangsa_688478000a3dff762587d71f676dfe9f.plist'
cause='IllegalArgumentException: Missing mandatory entry 'extended_message'', skipping

I could find examples of plist with this key extended_message in the codechecker codeline on Github, but it is not really clear to me if this is a mandatory entry in the report structure (and there is a bug), or it's not mandatory (or deprecated) and Sonar is wrong expecting this key.

Do you have a clue maybe?

aallrd commented 2 years ago

I compared the plist reports from the Clang SA from CodeChecker and scan-build on the same source file. The reports show the same diagnostic but the CodeChecker one is missing the extended_message key:

It seems that the CodeChecker plist contains less keys than the scan-build one. Are they filtered somehow?

steakhal commented 2 years ago

Could you please share the reproducer c++ file? Also the clang --version would help a lot.

I tried to reconstruct a dead store example according to your first plist, but I still end up having the extended_message field in the report: https://godbolt.org/z/GTKKajcvY