skip to main content
10.1145/328690.328704acmconferencesArticle/Chapter ViewAbstractPublication PagespepmConference Proceedingsconference-collections
Article
Free Access

Symbolic pointer analysis for detecting memory leaks

Authors Info & Claims
Published:01 November 1999Publication History

ABSTRACT

It is well accepted that pointers are a common source of memory anomalies such as loosing references to dynamic records without deallocating them (also known as memory leaks). This paper presents a novel pointer analysis framework that detects memory leaks by statically analyzing the behavior of programs.

Our approach is based on symbolic evaluation of programs. Symbolic evaluation is an advanced static symbolic analysis that is centered around symbolic variable values, assumptions about and constraints between variable values, and control flow information (path conditions). As part of symbolic evaluation we introduce a new symbolic heap algebra for modeling heap operations. Predicates — defined over the program's input — are derived which allow to detect memory leaks. Our approach goes beyond previous work in the field of statically detecting memory leaks by considering also path conditions which increases the accuracy of our results, symbolically modeling heap data structures and heap operations. Examples are used to illustrate the effectiveness of our approach.

References

  1. 1.T. Austin, S. Breach, and G. Sohi. Efficient detection of all pointer and array access errors. In Conference on Programming Language Design and Implementation, Jun. 1994.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. 2.J. Blieberger, B. Burgstaller, and B. Scholz. Interprocedural Symbolic Evaluation of Ada Programs with Aliases. In Ada-Europe'99 International Conference on Reliable So.ware Technologies, pages 136-145, Santander, Spain, June 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 3.J. Blieberger, T. Fahringer, and B. Scholz. Symbolic cache analysis for real-time systems. To appear in Real- Time Systems Journal., 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 4.M. Burke, P. Carini, J.-D. Choi, and M. Hind. Flowinsensitive interprocedural alias analysis in the presence of pointers. In K. Pingali, U. Banerjee, D. Gelernter, A. Nicolau, and D. Padua, editors, Proceedings of the 7th International Workshop on Languages and Compilers for Parallel Computing, Lecture Notes in Computer Science, pages 234-250, ithaca, New York, Aug. 8-10, 1994. Springer-Verlag.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 5.A. Deutsch. Semantic models and abstract interpretation techniques for inductive data structures and pointers. In Symposium on Partial Evaluation and Semantics-Based Program Manipulation, June 1995.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 6.E. Dijkstra. A discipline of programming. Prentice Hall, New Jersey, 1976.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 7.N. Dot, M. Rodeh, and M. Sagiv. Detecting memory errors via static pointer analysis. In Workshop on Program Analysis for Software Tools and Engineering PARLE'98. ACM Press, 1998.]]Google ScholarGoogle Scholar
  8. 8.M. Emami, R. Ghiya, and L. J. Hendren. Contextsensitive interprocedural points-to analysis in the presence of function pointers. A CM SIGPLAN Notices, 29(6):242-256, June 1994.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. 9.D. Evans. Static detection of dynamic memory errors. In SIGPLAN Conference on Programming Language Design and Implementation (PLDI '96), May 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 10.T. Fahringer. Efficient Symbolic Analysis for Parallelizing Compilers and Performance Estimators. Journal of Supercomputing, Kluwer Academic Publishers, 12(3), 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. 11.T. Fahringer. Symbolic Analysis Techniques for Program Parallelization. Journal of Future Generation Computer Systems, Elsevier Science, North-Holland, 13(1997/98):385-396, March 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. 12.T. Fahringer and B. Scholz. Symbolic Evaluation for Parallelizing Compilers. In Proc. of the A CM International Conference on Supercomputing, July 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. 13.T. Fahringer and B. Scholz. A unified symbolic evaluation framework for parallelizing compilers. Submitted, http://ww-w.par.univie.ac.at/~tf/papers/ symbolic/symbol_eval, ps, 1998.]]Google ScholarGoogle Scholar
  14. 14.P. Fradet, R. Caugne, and D. L. M@tayer. Static detection of pointer errors: An axiomatisation and a checking algorithm. In H. R. Nielson, editor, Programming Languages and Systems--ESOP'96, 6th European Symposium on Programming, volume 1058 of LNCS, LinkSping, Sweden, 22-24 Apr. 1996. Springer.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. 15.1%. Ghiya and L. Hendren. Is it a tree, a DAG, or a cyclic graph? A shape analysis for heap-directed pointers in C. In Symposium on Principles of Programming Languages. ACM Press, Jan. 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. 16.R. Ghiya and L. Hendren. Putting pointer analysis to work. In Symposium on Principles of Programming Languages, Jan. 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. 17.R. Ghiya and L. J. Hendren. Connection analysis: A practical interprocedural heap analysis for C. International Journal of Parallel Programming, 24(6):547-578, Dec. 1996.]]Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. 18.L. Hendren and A. Nicolau. Parallelizing programs with recursive data structures. IEEE Transactions on Parallel and Distributed Systems, 1(1):35-47, jan. 1990.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. 19.J. L. Jensen, M. E. Jorgensen, M. I. Schwartzbach, and N. Klarlund. Automatic verification of pointer programs using monadic second-order logic. In Proceedings of the A CM SIGPLAN Conference on Programming Language Design and Implementation (PLDI-97), volume 32, 5 of A CM SIGPLAN Notices, pages 226-234, New York, June15-18 1997. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. 20.N. D. Jones and S. S. Muchnick. Flow analysis and optimization of Lisp-like structures. In S. S. Muchnick and N. D. Jones, editors, Program Flow Analysis: Theory and Applications, pages 102-131. Englewood Cliffs, N.J.: Prentice-Hall, 1981.]]Google ScholarGoogle Scholar
  21. 21.W. Landi and B. G. Ryder. Safe approximate algorithm for interprocedural pointer aliasing. A CM SIGPLAN Notices, 27(7):235-248, 1992.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. 22.M. Sagiv, T. Reps, and R. Wilhelm. Solving shapeanalysis problems in languages with destructive updating. In Symposium on Principles of Programming Languages, St. Petersburg Beach, FL, Jan.Jan. 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. 23.M. Sagiv, T. Reps, and 1%. Wilhelm. Solving shapeanalysis problems in languages with destructive updating. A CM Transactions on Programming Languages and Systems, 20(1):1-50, Jan. 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. 24.R. Tennent. Denotational semantics of programming languages. Communication o} the A CM, 19(8), Aug. 1976.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. 25.R. P. Wilson and M. S. Lain. Efficient context-sensitive pointer analysis for C programs. In Proceedings of the ACM SIGPLAN'95 Con}erenc~ on Programmin9 Language Design and Implementation (PLDI), La Jolla, California, 18-21 June 1995.]] Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Symbolic pointer analysis for detecting memory leaks

      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
        PEPM '00: Proceedings of the 2000 ACM SIGPLAN workshop on Partial evaluation and semantics-based program manipulation
        January 2000
        113 pages
        ISBN:1581132018
        DOI:10.1145/328690

        Copyright © 1999 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: 1 November 1999

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • Article

        Acceptance Rates

        PEPM '00 Paper Acceptance Rate11of20submissions,55%Overall Acceptance Rate66of120submissions,55%

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader