Context- and path-sensitive memory leak detection
Yichen Xie, Alex Aiken · ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE) · 2005
We present a context- and path-sensitive algorithm for detecting memory leaks in programs with explicit memory management. Our leak detection algorithm is based on an underlying escape analysis: any allocated location in a procedure P that is not deallocated in P and does not escape from P is leaked. We achieve very precise context- and path-sensitivity by expressing our analysis using boolean constraints. In experiments with six large open source projects our analysis produced 510 warnings of which 455 were unique memory leaks, a false positive rate of only 10.8%. A parallel implementation improves performance by over an order of magnitude on large projects; over five million lines of code in the Linux kernel is analyzed in 50 minutes.
Cited by 118 works. doi:10.1145/1081706.1081728
Authors
References
- A static analyzer for finding dynamic programming errors
- Efficient context-sensitive pointer analysis for C programs
- Static detection of dynamic memory errors
- Context-sensitive interprocedural points-to analysis in the presence of function pointers
- Efficient context-sensitive pointer analysis for C programs
- A safe approximate algorithm for interprocedural aliasing
- Compositional pointer and escape analysis for Java programs
- Behavioral consistency of C and verilog programs using bounded model checking
- Finding bugs with a constraint solver
- Scalable error detection using boolean satisfiability