codechecker icon indicating copy to clipboard operation
codechecker copied to clipboard

Fb infer

Open stt08 opened this issue 1 year ago • 3 comments

Adding facebook infer analyzer support FIXES #4189

stt08 avatar Jun 06 '24 07:06 stt08

I've not tried it, but this integration should support the new 1.2.0 release of infer. https://github.com/facebook/infer/releases/tag/v1.2.0

vodorok avatar Jun 24 '24 08:06 vodorok

I retried this PR with infer 1.1.0.

I could not list the checkers

CodeChecker checkers --analyzers infer
[ERROR 2024-08-26 17:08] - None
[ERROR 2024-08-26 17:08] - None
[INFO 2024-08-26 17:08] - No checkers with the given label found.

and I could not execute the analysis either, I guess because it could not list checker.

workspace/test-projects/xerces-c]$ CodeChecker analyze ./compile_commands.json --analyzers=infer -e infer -o ./reports-infer
[ERROR 2024-08-26 17:09] - None
[INFO 2024-08-26 17:09] - No checkers enabled for infer
[ERROR 2024-08-26 17:09] - No checker(s) with these names was found:
infer

I think the problem is that the timezone setting is incorrect for infer.

infer
Uncaught Internal Error: ("unknown zone" (zone :Europe/Budapest))
Error backtrace:
Raised at Base__Error.raise in file "src/error.ml" (inlined), line 8, characters 14-30
Called from Base__Error.raise_s in file "src/error.ml", line 9, characters 19-40
Called from CamlinternalLazy.force_lazy_block in file "camlinternalLazy.ml", line 31, characters 17-27
Re-raised at CamlinternalLazy.force_lazy_block in file "camlinternalLazy.ml", line 36, characters 4-11
Called from IBase__ResultsDir.RunState.run_time_string in file "src/base/ResultsDir.ml", line 14, characters 24-53

Run the command again with `--keep-going` to try and ignore this error.
(CodeChecker venv-dev) ednikru@seliiuvd02700[14:47][build/CodeChecker/bin]$ echo $?
2

Could you please print the stderror from the analyzer tool in as CodeChecker error log when invocation of the tools fails? This way the user could debug a failing analyzer binary.

Or course when I set export TIMEZONE=UTC in my shell, infer was working correctly through CodeChecker. So this is about error handling.

dkrupp avatar Aug 27 '24 12:08 dkrupp

Infer 1.1.0 drops the following error if the timezone is not set to UTC:

infer
Uncaught Internal Error: ("unknown zone" (zone :Europe/Budapest))
Error backtrace:
Raised at Base__Error.raise in file "src/error.ml" (inlined), line 8, characters 14-30
Called from Base__Error.raise_s in file "src/error.ml", line 9, characters 19-40
Called from CamlinternalLazy.force_lazy_block in file "camlinternalLazy.ml", line 31, characters 17-27
Re-raised at CamlinternalLazy.force_lazy_block in file "camlinternalLazy.ml", line 36, characters 4-11
Called from IBase__ResultsDir.RunState.run_time_string in file "src/base/ResultsDir.ml", line 14, characters 24-53

This also means that the CodeChecker checkers --analyzers infer lists nothing and the infer analyzer is unusable from under codechecker.

Please add the TZ=UTC environment variable where you invoke infer as a workaround.

TZ=UTC infer
Nothing to compile. Have you run `infer capture`? Try cleaning the build first.
There was nothing to analyze.

  No issues found  

like this, it works.

dkrupp avatar Sep 13 '24 09:09 dkrupp