2003 · 119 citations · 19 references
ComputingComputer EngineeringComputer ScienceFormal MethodsProgramming LanguagesSystems ProgrammingData-flow AnalysisLeak DetectionMemory Consistency ModelsMemory ManagementType CheckingType SystemsContext-sensitive AnalysisContext-sensitive LanguagesHeap AnalysisMemory Corruption DetectionMemory Leak DetectionMemory Leaks
This paper presents a static analysis tool that can automatically find memory leaks and deletions of dangling pointers in large C and C++ applications.We have developed a type system to formalize a practical ownership model of memory management. In this model, every object is pointed to by one and only one owning pointer, which holds the exclusive right and obligation to either delete the object or to transfer the right to another owning pointer. In addition, a pointer-typed class member field is required to either always or never own its pointee at public method boundaries. Programs satisfying this model do not leak memory or delete the same object more than once.We have also developed a flow-sensitive and context-sensitive algorithm to automatically infer the likely ownership interfaces of methods in a program. It identifies statements inconsistent with the model as sources of potential leaks or double deletes. The algorithm is sound with respect to a large subset of the C and C++ language in that it will report all possible errors. It is also practical and useful as it identifies those warnings likely to correspond to errors and helps the user understand the reported errors by showing them the assumed method interfaces.Our techniques are validated with an implementation of a tool we call Clouseau. We applied Clouseau to a suite of applications: two web servers, a chat client, secure shell tools, executable object manipulation tools, and a compiler. The tool found a total of 134 serious memory errors in these applications. The tool analyzes over 50K lines of C++ code in about 9 minutes on a 2 GHz Pentium 4 machine and over 70K lines of C code in just over a minute.
19
A Syntactic Approach to Type Soundness
Andy Wright, Matthias Felleisen · Information and Computation · 1994 · 1.1K citations
Dawson Engler, David Yu Chen, Seth Hallem et al. · 2001 · 747 citations
Region-Based Memory Management
Mads Tofte, Jean-Pierre Talpin · Information and Computation · 1997 · 617 citations
Ownership types for flexible alias protection
David G. Clarke, John Potter, James Noble · 1998 · 578 citations · Full text
Ownership types for safe programming
Chandrasekhar Boyapati, Robert Lee, Martin Rinard · 2002 · 571 citations