You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Infinite hang with CodeChecker on clang without analyser #2670
Describe the bug
If the clang binary used from PATH is built without Clang Static Analyzer, the fetching of checkers hangs infinitely.
CodeChecker version
Irrelevant, but exists with 6.11.
To Reproduce
Steps to reproduce the behaviour:
Build LLVM/Clang without ClangSA: cmake ... -DCLANG_ENABLE_STATIC_ANALYZER=OFF
Put the Build/bin into PATH
Run something from CodeChecker that has to fetch checkers: checkers, analyze.
Wait infinitely.
See error
Expected behaviour
Fetch that there are no ClangSA checkers in the list, but do not hang.
Desktop (please complete the following information)
OS: Linux
Additional context
The issue is due to Clang dumping checker list by calling clang++ -cc1 -analyzer-checker-help. If there is a static analyzer, this dumps the checker list and early returns — but if there is no ClangSA built, the call is "equivalent" to calling clang++ -cc1 which will wait for preprocessed text on the standard input.
In case the standard input is not the tty stdin, but a file, e.g. calling: echo "" | clang -cc1 -analyzer-checker-help
when there is ClangSA built: same output as usual
when there is no ClangSA: output is an empty string, but the binary exits immediately and without side effects seemingly.
The issue might need to be fixed within Clang, in addition, because it is bad behaviour there that it starts waiting for stdin...
Is timeout a good choice? The problem with timeouts is that we can never know what's sensible. If we set it to, let's say, 10 seconds, but the machine the tool is running on is so loaded (or has network-mounted storage?) that loading the checker list (for example if plugins are used) would take 15 seconds, it'll falsely say that there are no checkers.
Another interesting thing: I tried disabling clangsa by specifying --analyzers clang-tidy to the analyze command but it still tries to access the clang binary (for some resource dir printing stuff) and also tries getting the checkers, resulting in this hang.
Activity
irishrover commentedon Apr 4, 2020
It's called via
subprocess.check_output, sotimeoutparam can be used to fix the hang.https://docs.python.org/3/library/subprocess.html#subprocess.check_output
whisperity commentedon Apr 7, 2020
Is
timeouta good choice? The problem with timeouts is that we can never know what's sensible. If we set it to, let's say, 10 seconds, but the machine the tool is running on is so loaded (or has network-mounted storage?) that loading the checker list (for example if plugins are used) would take 15 seconds, it'll falsely say that there are no checkers.whisperity commentedon May 12, 2020
Another interesting thing: I tried disabling clangsa by specifying
--analyzers clang-tidyto theanalyzecommand but it still tries to access theclangbinary (for some resource dir printing stuff) and also tries getting the checkers, resulting in this hang.whisperity commentedon Aug 22, 2025
(Bump: I ran into this thing again today. 😬)
SamirRafiei commentedon Sep 9, 2026
I would like to work on this issue.