Cross Translation Unit analysis fails to detect wrapped allocations #4221
Replies: 2 comments 1 reply
-
CTU needs source code to analyse. If your implementation is in third-party libraries without source code (i.e., not part of your project, not present in the |
Beta Was this translation helpful? Give feedback.
-
There are several "budgets" (usually these are unitless scalar counters) internally in the Clang Static Analyzer, and if the budget for an action (such as loop unrolling, or inlining of functions, or the opening of external TUs) is exhausted, either that action will be skipped (and the analysis is continued as if the result of that action was "unknown") or the entire analysis of that call graph is stopped. Some of these budgets can be configured by passing the right combination of arguments directly to the Clang binary, but some of these budgets are hardcoded and need a custom build of Clang to have the changes apply. You can find the names and the meaning of such "engine flags" here: https://github.com/llvm/llvm-project/blob/main/clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.def. (I'm sure there is a command-line combination of --help flags that dump these as well, but I do not know the exact details.) There is something called The number of TUs loaded during an analysis is also limited by These flags you can query through CodeChecker like this: |
Beta Was this translation helpful? Give feedback.
-
Hi folks,
CodeChecker analyze compile_commands.json --enable sensitive --ctu --analyzers clangsa --jobs 16 --output <>
libfoo.so
which calls an allocation function inlibbar.so
, this allocation function is a wrapper over malloc. However a real leak inlibfoo.so
goes undetected.Beta Was this translation helpful? Give feedback.
All reactions