Index: clang/www/analyzer/open_projects.html =================================================================== --- clang/www/analyzer/open_projects.html +++ clang/www/analyzer/open_projects.html @@ -22,162 +22,187 @@ to the cfe-dev mailing list to notify other members of the community.
-BodyFarm - allows the analyzer to explicitly model functions whose definitions are - not available during analysis. Modeling more of the widely used functions - (such as the members of std::string) will improve precision of the - analysis. - (Difficulty: Easy, ongoing)
-
New checkers which were contributed to the analyzer, + but have not passed a rigorous evaluation process, + are committed as "alpha checkers" (from "alpha version"), + and are not enabled by default. + + The development of many such checkers has stalled over the years. + Current "alpha" checkers need a cleanup: + checkers which have been there for a long time should either + be improved up to a point where they can be enabled by default, + or removed, if such an improvement is not possible. + Most notably, these checkers could be "graduated" out of alpha + if a consistent effort is applied: + +
alpha.security.ArrayBound
and
+ alpha.security.ArrayBoundV2
+ Array bounds checking is a desired feature, + but having an acceptable rate of false positives might not be possible + without a proper + loop widening support. + Additionally, it might be more promising to perform index checking based on + tainted index values. + (Difficulty: Medium)
+alpha.cplusplus.MisusedMovedObject
+ The checker emits a warning on objects which were used after + move. + Currently it has an overly high false positive rate due to classes + which have a well-defined semantics for use-after-move. + This property does not hold for STL objects, but is often the case + for custom containers. + (Difficulty: Medium)
+alpha.unix.StreamChecker
+ A SimpleStreamChecker has been presented in the Building a Checker in 24 + Hours talk + (slides + video).
+ +This alpha checker is an attempt to write a production grade stream checker.
+ However, it was found to have an unacceptably high false positive rate.
+ One of the found problems was that eagerly splitting the state
+ based on whether the system call may fail leads to too many reports.
+ A delayed split where the implication is stored in the state
+ (similarly to nullability implications in TrustNonnullChecker
)
+ may produce much better results.
(Difficulty: Medium)
+Currently, the analyzer treats all floating-point values as unknown. - However, we already have most of the infrastructure we need to handle - floats: RangeConstraintManager. This would involve adding a new SVal kind - for constant floats, generalizing the constraint manager to handle floats - and integers equally, and auditing existing code to make sure it doesn't - make untoward assumptions. - (Difficulty: Medium)
-Currently, the analyzer simply unrolls each loop N times. This - means that it will not execute any code after the loop if the loop is - guaranteed to execute more than N times. This results in lost - basic block coverage. We could continue exploring the path if we could - model a generic i-th iteration of a loop. - (Difficulty: Hard)
+Aggregates
+ are objects that can be brace-initialized without calling a
+ constructor (that is,
+ CXXConstructExpr
does not occur in the AST),
+ but potentially calling
+ constructors for their fields and base classes
+ These
+ constructors of sub-objects need to know what object they are constructing.
+ Moreover, if the aggregate contains
+ references, lifetime extension needs to be properly modeled.
+
+ One can start untangling this problem by trying to replace the
+ current ad-hoc
+ ParentMap
lookup in
+ CXXConstructExpr::CK_NonVirtualBase
branch of
+ ExprEngine::VisitCXXConstructExpr()
+ with proper support for the feature.
+ (Difficulty: Medium)
There is an existing implementation of this, but it's not complete and - is disabled in the analyzer. - (Difficulty: Medium; current contact: Alex McCarthy)
- -Currently exceptions are treated as "black holes", and exception-handling - control structures are poorly modeled (to be conservative). This could be - much improved for both C++ and Objective-C exceptions. - (Difficulty: Medium)
- -new
more precisely.
- The current representation of new
does not provide an easy
- way for the analyzer to model the call to a memory allocation function
- (operator new
), then initialize the result with a constructor
- call. The problem is discussed at length in
- PR12014.
- (Difficulty: Easy; current contact: Karthik Bhat)
delete
more precisely.
- Similarly, the representation of delete
does not include
- the call to the destructor, followed by the call to the deallocation
- function (operator delete
). One particular issue
- (noreturn destructors) is discussed in
- PR15599
- (Difficulty: Easy; current contact: Karthik Bhat)
Constraints on the bits of an integer are not easily representable as - ranges. A bitwise constraint manager would model constraints such as "bit 32 - is known to be 1". This would help code that made use of bitmasks. - (Difficulty: Medium)
+The analyzer needs a better understanding of STL in order to be more
+ useful on C++ codebases.
+ While full library modeling is not an easy task,
+ large gains can be achieved by supporting only a few cases:
+ e.g. calling .length()
on an empty
+ std::string
always yields zero.
+ (Difficulty: Medium)
The DynamicTypePropagation checker is in charge of inferring a region's - dynamic type based on what operations the code is performing. Casts are a - rich source of type information that the analyzer currently ignores. They - are tricky to get right, but might have very useful consequences. - (Difficulty: Medium)
- -Implement unifying two symbolic values along a path after they are - determined to be equal via comparison. This would allow us to reduce the - number of false positives and would be a building step to more advanced - analyses, such as summary-based interprocedural and cross-translation-unit - analysis. - (Difficulty: Hard)
-It would be great to have more code reuse between "Minimal" and - "Extensive" PathDiagnostic generation algorithms. One idea is to create an - IR for representing path diagnostics, which would be later be used to - generate minimal or extensive report output. (Difficulty: Medium)
+Currently exceptions are treated as "black holes", and exception-handling + control structures are poorly modeled in order to be conservative. + This could be improved for both C++ and Objective-C exceptions. + (Difficulty: Medium)
(Difficulty: Easy)
+Currently in the analyzer the value of a union is always regarded as + an unknown. + This problem was + previously discussed + on the mailing list, but no solution was implemented. + (Difficulty: Medium)
Currently, scan-build just sets the CC and CXX - environment variables to its wrapper scripts, which then call into an - underlying platform compiler. This is problematic for any project that - doesn't exclusively use CC and CXX to control its - compilers. -
(Difficulty: Medium-Hard)
+Currently, the analyzer treats all floating-point values as unknown.
+ This project would involve adding a new SVal
kind
+ for constant floats, generalizing the constraint manager to handle floats,
+ and auditing existing code to make sure it doesn't
+ make incorrect assumptions (most notably, that X == X
+ is always true, since it does not hold for NaN
).
+ (Difficulty: Medium)
We would like to put all analyzer attributes behind a fence so that we - could add/remove them without worrying that compiler (not analyzer) users - depend on them. Design and implement such a generic analyzer attribute in - the compiler. (Difficulty: Medium)
+The analyzer simply unrolls each loop N times before + dropping the path, for a fixed constant N. + However, that results in lost coverage in cases where the loop always + executes more than N times. + Péter Szécsi has completed a Google Summer Of Code + project + which has made the loop bound parameterizable, + but the widening + problem still remains open. + + (Difficulty: Hard)
A SimpleStreamChecker has been presented in the Building a Checker in 24 - Hours talk - (slides - video). - We need to implement a production version of the checker with richer set of - APIs and evaluate it by running on real codebases. - (Difficulty: Easy)
+The analyzer performs inter-procedural analysis using + either inlining or "conservative evaluation" (invalidating all data + passed to the function). + Often, a very simple summary + (e.g. "this function is pure") would be + enough to be a large improvement over conservative evaluation. + Such summaries could be obtained either syntactically, + or using a dataflow framework. + (Difficulty: Hard)
This would require extending the MallocPessimistic checker to reason - about annotated functions. It is strongly desired that one would rely on - the analyzer_annotate attribute, as described above. - (Difficulty: Easy)
+The analyzer core + implements a symbolic execution + engine, which performs checks + (use-after-free, uninitialized value read, etc.) + over a single program path. + However, many useful properties + (dead code, check-after-use, etc.) require + reasoning over all possible in a program. + Such reasoning requires a + dataflow analysis framework. + Clang already implements + a few dataflow analyses (most notably, liveness), + but they implemented in an ad-hoc fashion. + A proper framework would enable us writing many more useful checkers. + (Difficulty: Hard)
Symbolic expressions of the form $sym & CONSTANT
can range from 0 to CONSTANT-
1 if CONSTANT is 2^n-1
, e.g. 0xFF (0b11111111), 0x7F (0b01111111), 0x3 (0b0011), 0xFFFF, etc. Even without handling general bitwise operations on symbols, we can at least bound the value of the resulting expression. Bonus points for handling masks followed by shifts, e.g. ($sym & 0b1100) >> 2
.
- (Difficulty: Easy)
The DynamicTypePropagation
+ checker is in charge of inferring a region's
+ dynamic type based on what operations the code is performing.
+ Casts are a rich source of type information that the analyzer currently ignores.
+ (Difficulty: Medium)
(Difficulty: Easy)
-Take a look at the - CP-Miner - paper for inspiration. - (Difficulty: Medium-Hard; current contacts: Daniel Marjamäki and Daniel Fahlgren)
-Apart from the open projects listed above, + contributors are welcome to fix any of the outstanding + bugs + in the Bugzilla. + (Difficulty: Anything)
+