[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
10.1145/1250734.1250789acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
Article

Practical memory leak detection using guarded value-flow analysis

Published: 10 June 2007 Publication History

Abstract

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 flowgraph. 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.

References

[1]
Thomas Ball, Rupak Majumdar, Todd Millstein, and Sriram K. Rajamani. Automatic predicate abstraction of C programs. In Proceedings of the ACM Conference on Program Language Design and Implementation, Snowbird, Utah, June 2001.
[2]
Thomas Ball and Sriram K. Rajamani. The SLAM project: debugging system software via static analysis. In Proceedings of the Annual ACM Symposium on the Principles of Programming Languages, Portland, OR, January 2002.
[3]
Ron Cytron, Jeanne Ferrante, Barry Rosen, Mark Wegman, and F. Kenneth Zadeck. An efficient method of computing static single assignment form. In Proceedings of the Annual ACM Symposium on the Principles of Programming Languages, Austin, TX, June 1989.
[4]
Manuvir Das, Sorin Lerner, and Mark Seigle. ESP: Path-sensitive program verification in polynomial time. In Proceedings of the ACM Conference on Program Language Design and Implementation, Berlin, Germany, June 2002.
[5]
Nurit Dor, Michael Rodeh, and Mooly Sagiv. Checking cleanness in linked lists. In Proceedings of the International Static Analysis Symposium, Santa Barbara, CA, July 2000.
[6]
Dawson Engler, Benjamin Chelf, Andy Chou, and Seth Hallem. Checking system rules using system-specific, programmer-written compiler extensions. In Proceedings of the Symposium on Operating System Design and Implementation, San Diego, CA, October 2000.
[7]
Jeffrey S. Foster, Robert Johnson, John Kodumal, and Alex Aiken. Flow-insensitive type qualifiers. ACM Transactions on Programming Languages and Systems, 28(6):1035--1087, November 2006.
[8]
Emden R. Gansner and Stephen C. North. An open graph visualization system and its applications to software engineering. Software -- Practice and Experience, 30(11):1203--1233, 2000.
[9]
Brian Hackett and Radu Rugina. Shape analysis with tracked locations. In Proceedings of the Annual ACM Symposium on the Principles of Programming Languages, Long Beach, CA, January 2005.
[10]
David L. Heine and Monica S. Lam. A practical flow-sensitive and context-sensitive C and C++ memory leak detector. In Proceedings of the ACM Conference on Program Language Design and Implementation, San Diego, CA, June 2003.
[11]
David L. Heine and Monica S. Lam. Static detection of leaks in polymorphic containers. In Proceeding of the International Conference on Software Engineering (ICSE), Shanghai, China, May 2006.
[12]
Gerard J. Holzmann. UNO: Static source code checking for userdefined properties. In Proceedings of the World Conference on Integrated Design and Process Technology, Pasadena, CA, June 2002.
[13]
V. Benjamin Livshits and Monica S. Lam. Tracking pointers with path and context sensitivity for bug detection in C programs. In ACM SIGSOFT Symposium on the Foundations of Software Engineering, Helsinki, Finland, September 2003.
[14]
Maksim Orlovich and Radu Rugina. Memory leak analysis by contradition. In Proceedings of the International Static Analysis Symposium, Seoul, Korea, August 2006.
[15]
Daniel Le Berre (project leader). SAT4J: A satisfiability library for java. http://www.sat4j.org/, January 2006.
[16]
Thomas Reps, Susan Horowitz, and Mooly Sagiv. Precise interprocedural dataflow analysis via graph reachability. In Proceedings of the Annual ACM Symposium on the Principles of Programming Languages, San Francisco, CA, January 1995.
[17]
Mooly Sagiv, Thomas Reps, and Reinhard Wilhelm. Parametric shape analysis via 3-valued logic. In Proceedings of the Annual ACM Symposium on the Principles of Programming Languages, San Antonio, TX, January 1999.
[18]
Gregor Snelting, Torsten Robschink, and Jens Krinke. Efficient path conditions in dependence graphs for software safety analysis. ACM Transactions on Software Engineering and Methodology, 15(4):410--457, October 2006.
[19]
Bjarne Steensgaard. Points-to analysis in almost linear time. In Proceedings of the Annual ACM Symposium on the Principles of Programming Languages, St. Petersburg Beach, FL, January 1996.
[20]
Peng Tu and David Padua. Efficient building and placing of gating functions. In Proceedings of the ACM Conference on Program Language Design and Implementation, La Jolla, CA, June 1995.
[21]
J. Uniejewski. SPEC Benchmark Suite: Designed for today's advanced systems. SPEC Newsletter Volume 1, Issue 1, SPEC, Fall 1989.
[22]
Yichen Xie and Alex Aiken. Context- and path-sensitive memory leak detection. In ACM SIGSOFT Symposium on the Foundations of Software Engineering, Lisbon, Portugal, September 2005.
[23]
Junfeng Yang, Paul Twohey, Dawson Engler, and Madanlal Musuvathi. Using model checking to find serious file system errors. In Proceedings of the Symposium on Operating System Design and Implementation, San Francisco, CA, December 2004.

Cited By

View all
  • (2024)SPATA: Effective OS Bug Detection with Summary-Based, Alias-Aware, and Path-Sensitive Typestate AnalysisACM Transactions on Computer Systems10.1145/369525042:3-4(1-40)Online publication date: 6-Sep-2024
  • (2024)Exploring Scalability of Value-Flow Graph ConstructionProceedings of the 2024 4th International Conference on Artificial Intelligence, Automation and High Performance Computing10.1145/3690931.3690951(112-117)Online publication date: 19-Jul-2024
  • (2024)Automatically Inspecting Thousands of Static Bug Warnings with Large Language Model: How Far Are We?ACM Transactions on Knowledge Discovery from Data10.1145/365371818:7(1-34)Online publication date: 26-Mar-2024
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
PLDI '07: Proceedings of the 28th ACM SIGPLAN Conference on Programming Language Design and Implementation
June 2007
508 pages
ISBN:9781595936332
DOI:10.1145/1250734
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 42, Issue 6
    Proceedings of the 2007 PLDI conference
    June 2007
    491 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/1273442
    Issue’s Table of Contents
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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 10 June 2007

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. memory leaks
  2. memory management
  3. static error detection
  4. value-flow analysis

Qualifiers

  • Article

Conference

PLDI '07
Sponsor:

Acceptance Rates

Overall Acceptance Rate 406 of 2,067 submissions, 20%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)77
  • Downloads (Last 6 weeks)11
Reflects downloads up to 31 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2024)SPATA: Effective OS Bug Detection with Summary-Based, Alias-Aware, and Path-Sensitive Typestate AnalysisACM Transactions on Computer Systems10.1145/369525042:3-4(1-40)Online publication date: 6-Sep-2024
  • (2024)Exploring Scalability of Value-Flow Graph ConstructionProceedings of the 2024 4th International Conference on Artificial Intelligence, Automation and High Performance Computing10.1145/3690931.3690951(112-117)Online publication date: 19-Jul-2024
  • (2024)Automatically Inspecting Thousands of Static Bug Warnings with Large Language Model: How Far Are We?ACM Transactions on Knowledge Discovery from Data10.1145/365371818:7(1-34)Online publication date: 26-Mar-2024
  • (2024) Octopus: Scaling Value-Flow Analysis via Parallel Collection of Realizable Path ConditionsACM Transactions on Software Engineering and Methodology10.1145/363274333:3(1-33)Online publication date: 24-Jan-2024
  • (2024)Precise Sparse Abstract Execution via Cross-Domain InteractionProceedings of the IEEE/ACM 46th International Conference on Software Engineering10.1145/3597503.3639220(1-12)Online publication date: 20-May-2024
  • (2024)LibAlchemy: A Two-Layer Persistent Summary Design for Taming Third-Party Libraries in Static Bug-Finding SystemsProceedings of the IEEE/ACM 46th International Conference on Software Engineering10.1145/3597503.3639132(1-13)Online publication date: 20-May-2024
  • (2024)Fast and Precise Static Null Exception Analysis With Synergistic PreprocessingIEEE Transactions on Software Engineering10.1109/TSE.2024.346655150:11(3022-3036)Online publication date: Nov-2024
  • (2024)rCanary: Detecting Memory Leaks Across Semi-Automated Memory Management Boundary in RustIEEE Transactions on Software Engineering10.1109/TSE.2024.344362450:9(2472-2484)Online publication date: 13-Aug-2024
  • (2024)Exploration On Prompting LLM With Code-Specific Information For Vulnerability Detection2024 IEEE International Conference on Software Services Engineering (SSE)10.1109/SSE62657.2024.00049(273-281)Online publication date: 7-Jul-2024
  • (2024)A Dynamic Memory Leak Detection Method for Linux Based on eBPF Uprobe and LKM2024 4th International Conference on Computer Systems (ICCS)10.1109/ICCS62594.2024.10795839(192-197)Online publication date: 20-Sep-2024
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media