skip to main content
10.1145/2338965.2336784acmconferencesArticle/Chapter ViewAbstractPublication PagesisstaConference Proceedingsconference-collections
Article

Static memory leak detection using full-sparse value-flow analysis

Published:15 July 2012Publication History

ABSTRACT

We introduce a static detector, Saber, for detecting memory leaks in C programs. Leveraging recent advances on sparse pointer analysis, Saber is the first to use a full-sparse value-flow analysis for leak detection. Saber tracks the flow of values from allocation to free sites using a sparse value-flow graph (SVFG) that captures def-use chains and value flows via assignments for all memory locations represented by both top-level and address-taken pointers. By exploiting field-, flow- and context-sensitivity during different phases of the analysis, Saber detects leaks in a program by solving a graph reachability problem on its SVFG. Saber, which is fully implemented in Open64, is effective at detecting 211 leaks in the 15 SPEC2000 C programs and five applications, while keeping the false positive rate at 18.5%. We have also compared Saber with Fastcheck (which analyzes allocated objects flowing only into top-level pointers) and Sparrow (which handles all allocated objects using abstract interpretation) using the 15 SPEC2000 C programs. Saber is as accurate as Sparrow but is 14.2X faster and reports 40.7% more bugs than Fastcheck at a slightly higher false positive rate but is only 3.7X slower.

References

  1. D. Bruening and Q. Zhao. Practical memory checking with Dr. Memory. In CGO'11. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. S. Cherem, L. Princehouse, and R. Rugina. Practical memory leak detection using guarded value-flow analysis. In PLDI'07. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. F. Chow, S. Chan, S. Liu, R. Lo, and M. Streich. Effective representation of aliases and indirect memory operations in SSA form. In CC'96. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. J. Clause and A. Orso. LEAKPOINT: pinpointing the causes of memory leaks. In ICSE'10. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. B. Hardekopf and C. Lin. Flow-sensitive pointer analysis for millions of lines of code. In CGO'11. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. B. Hardekopf and C. Lin. Semi-sparse flow-sensitive pointer analysis. In POPL'09. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. D.L. Heine and M.S. Lam. A practical flow-sensitive and context-sensitive C and C++ memory leak detector. PLDI'03. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. http://clang-analyzer.llvm.org/.Google ScholarGoogle Scholar
  9. Y. Jung and K. Yi. Practical memory leak detector based on parameterized procedural summaries. In ISMM'08. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. L. Li, C. Cifuentes, and N. Keynes. Boosting the performance of flow-sensitive points-to analysis using value flow. In FSE'11. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. V.B. Livshits and M.S. Lam. Tracking pointers with path and context sensitivity for bug detection in C programs. FSE'03. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. N. Nethercote and J. Seward. Valgrind: a framework for heavyweight dynamic binary instrumentation. PLDI'07. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. G. Novark, E.D. Berger, and B.G. Zorn. Efficiently and precisely locating memory leaks and bloat. PLDI'09. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. M. Orlovich and R. Rugina. Memory leak analysis by contradiction. SAS'06. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. T. Reps, S. Horwitz, and M. Sagiv. Precise interprocedural dataflow analysis via graph reachability. In POPL'95. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. L. Shang, X. Xie, and J. Xue. On-demand dynamic summary-based points-to analysis. In CGO'12. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Manu Sridharan and Rastislav Bodík. Refinement-based context-sensitive points-to analysis for Java. In PLDI'06. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Y. Sui, S. Ye, J. Xue, and P.C. Yew. SPAS: Scalable path-sensitive pointer analysis on full-sparse SSA. APLAS'11. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. E. Torlak and S. Chandra. Effective interprocedural resource leak detection. In ICSE'10. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Y. Xie and A. Aiken. Context-and path-sensitive memory leak detection. FSE'05. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Y. Xie and A. Aiken. Saturn: A scalable framework for error detection using boolean satisfiability. TOPLAS'07. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. G. Xu, M.D. Bond, F. Qin, and A. Rountev. LeakChaser: helping programmers narrow down causes of memory leaks. In PLDI'11. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. G. Xu and A. Rountev. Precise memory leak detection for Java software using container profiling. In ICSE'08. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. H. Yu, J. Xue, W. Huo, X. Feng, and Z. Zhang. Level by level: making flow-and context-sensitive pointer analysis scalable for millions of lines of code. In CGO'10. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Static memory leak detection using full-sparse value-flow analysis

                Recommendations

                Comments

                Login options

                Check if you have access through your login credentials or your institution to get full access on this article.

                Sign in
                • Published in

                  cover image ACM Conferences
                  ISSTA 2012: Proceedings of the 2012 International Symposium on Software Testing and Analysis
                  July 2012
                  341 pages
                  ISBN:9781450314541
                  DOI:10.1145/2338965

                  Copyright © 2012 ACM

                  Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                  Publisher

                  Association for Computing Machinery

                  New York, NY, United States

                  Publication History

                  • Published: 15 July 2012

                  Permissions

                  Request permissions about this article.

                  Request Permissions

                  Check for updates

                  Qualifiers

                  • Article

                  Acceptance Rates

                  Overall Acceptance Rate58of213submissions,27%

                  Upcoming Conference

                  ISSTA '24

                PDF Format

                View or Download as a PDF file.

                PDF

                eReader

                View online with eReader.

                eReader