A practical flow-sensitive and context-sensitive C and C++ memory leak detector

作者: David L. Heine , Monica S. Lam

DOI: 10.1145/780822.781150

关键词:

摘要: This paper presents a static analysis tool that can automatically find memory leaks and deletions of dangling pointers in large C C++ applications.We have developed type system to formalize practical ownership model management. In this model, every object is pointed by one only owning pointer, which holds the exclusive right obligation either delete or transfer another pointer. addition, pointer-typed class member field required always never own its pointee at public method boundaries. Programs satisfying do not leak same more than once.We also flow-sensitive context-sensitive algorithm infer likely interfaces methods program. It identifies statements inconsistent with as sources potential double deletes. The sound respect subset language it will report all possible errors. useful those warnings correspond errors helps user understand reported showing them assumed interfaces.Our techniques are validated an implementation we call Clouseau. We applied Clouseau suite applications: two web servers, chat client, secure shell tools, executable manipulation compiler. found total 134 serious these applications. analyzes over 50K lines code about 9 minutes on 2 GHz Pentium 4 machine 70K just minute.

参考文章(26)
Jeannette Wing, Daniel Jackson, Robert Weeks O'Callahan, Generalized aliasing as a basis for program analysis tools Carnegie Mellon University. ,(2001)
David Walker, Greg Morrisett, Alias Types for Recursive Data Structures Lecture Notes in Computer Science. pp. 177- 206 ,(2000) , 10.1007/3-540-45332-6_7
Michael Rodeh, Mooly Sagiv, Nurit Dor, Checking Cleanness in Linked Lists static analysis symposium. pp. 115- 134 ,(2000) , 10.1007/978-3-540-45099-3_7
A.K. Wright, M. Felleisen, A Syntactic Approach to Type Soundness Information & Computation. ,vol. 115, pp. 38- 94 ,(1994) , 10.1006/INCO.1994.1093
Dan Grossman, Greg Morrisett, Trevor Jim, Michael Hicks, Yanling Wang, James Cheney, Region-based memory management in cyclone Proceedings of the ACM SIGPLAN 2002 Conference on Programming language design and implementation - PLDI '02. ,vol. 37, pp. 282- 293 ,(2002) , 10.1145/512529.512563
David Evans, Static detection of dynamic memory errors Proceedings of the ACM SIGPLAN 1996 conference on Programming language design and implementation - PLDI '96. ,vol. 31, pp. 44- 53 ,(1996) , 10.1145/231379.231389
Karl Crary, David Walker, Greg Morrisett, Typed memory management in a calculus of capabilities Proceedings of the 26th ACM SIGPLAN-SIGACT symposium on Principles of programming languages - POPL '99. pp. 262- 275 ,(1999) , 10.1145/292540.292564
Dawson Engler, David Yu Chen, Seth Hallem, Andy Chou, Benjamin Chelf, Bugs as deviant behavior: a general approach to inferring errors in systems code symposium on operating systems principles. ,vol. 35, pp. 57- 72 ,(2001) , 10.1145/502034.502041
David K. Gifford, John M. Lucassen, Integrating functional and imperative programming international conference on functional programming. pp. 28- 38 ,(1986) , 10.1145/319838.319848
Dave Clarke, Sophia Drossopoulou, Ownership, encapsulation and the disjointness of type and effect Proceedings of the 17th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications - OOPSLA '02. ,vol. 37, pp. 292- 310 ,(2002) , 10.1145/582419.582447