Practical memory leak detection using guarded value-flow analysis

被引:19
作者
Cherem, Sigmund [1 ]
Princehouse, Lonnie [1 ]
Rugina, Radu [1 ]
机构
[1] Cornell Univ, Dept Comp Sci, Ithaca, NY 14853 USA
关键词
static error detection; memory leaks; memory management; value-flow analysis;
D O I
10.1145/1273442.1250789
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
This paper presents a practical inter-procedural analysis algorithm for detecting memory leaks in C programs. Our algorithm tracks the flow of values from allocation points to deallocation points using a sparse representation of the program consisting of a value flow graph that captures def-use relations and value flows via program assignments. Edges in the graph are annotated with guards that describe branch conditions in the program. The memory leak analysis is reduced to a reachability problem over the guarded value flow graph. Our implemented tool has been effective at detecting more than 60 memory leaks in the SPEC2000 benchmarks and in two open-source applications, bash and sshd, while keeping the false positive rate below 20%. The sparse program representation makes the tool efficient in practice, and allows it to report concise error messages.
引用
收藏
页码:480 / 491
页数:12
相关论文
共 23 条
[1]  
Ball T., 2002, P ACM S PRINC PROGR
[2]  
BALL T, 2001, P ACM C PROGR LANG D
[3]  
CYTRON R, 1989, P ACM S PRINC PROGR
[4]  
DAS M, 2002, P ACM C PROGR LANG D
[5]  
DOR N, 2000, P INT STAT AN S SANT
[6]  
Engler D, 2000, P S OP SYST DES IMPL
[7]   Flow-insensitive type qualifiers [J].
Foster, Jeffrey S. ;
Johnson, Robert ;
Kodumal, John ;
Aiken, Alex .
ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 2006, 28 (06) :1035-1087
[8]  
Gansner ER, 2000, SOFTWARE PRACT EXPER, V30, P1203, DOI 10.1002/1097-024X(200009)30:11<1203::AID-SPE338>3.0.CO
[9]  
2-N
[10]  
HACLETT N, 2006, P ACM S PRINC PROGR