skip to main content
article

Valgrind: a framework for heavyweight dynamic binary instrumentation

Published:10 June 2007Publication History
Skip Abstract Section

Abstract

Dynamic binary instrumentation (DBI) frameworks make it easy to build dynamic binary analysis (DBA) tools such as checkers and profilers. Much of the focus on DBI frameworks has been on performance; little attention has been paid to their capabilities. As a result, we believe the potential of DBI has not been fully exploited.

In this paper we describe Valgrind, a DBI framework designed for building heavyweight DBA tools. We focus on its unique support for shadow values-a powerful but previously little-studied and difficult-to-implement DBA technique, which requires a tool to shadow every register and memory value with another value that describes it. This support accounts for several crucial design features that distinguish Valgrind from other DBI frameworks. Because of these features, lightweight tools built with Valgrind run comparatively slowly, but Valgrind can be used to build more interesting, heavyweight tools that are difficult or impossible to build with other DBI frameworks such as Pin and DynamoRIO.

References

  1. V. Bala, E. Duesterwald, and S. Banerjia. Dynamo: A transparent dynamic optimization system. In Proceedings of PLDI 2000, pages 1--12, Vancouver, Canada, June 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. D. Bruening. Efficient, Transparent, and Comprehensive Runtime Code Manipulation. PhD thesis, MIT, Cambridge, Mass., USA, September 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. D. Bruening, T. Garnett, and S. Amarasinghe. An infrastructure for adaptive dynamic optimization. In Proceedings of CGO'03, pages 265--276, San Francisco, California, USA, March 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. M. Burrows, S. N. Freund, and J. L. Wiener. Run-time type checking for binary programs. In Proceedings of CC 2003, pages 90--105, Warsaw, Poland, April 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. W. Cheng. Personal communication, November 2006.Google ScholarGoogle Scholar
  6. W. Cheng, Q. Zhao, B. Yu, and S. Hiroshige. TaintTrace: Efficient flow tracing with dynamic binary rewriting. In Proceedings of ISCC 2006, pages 749--754, Cagliari, Sardinia, Italy, June 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. P. J. Guo, J. H. Perkins, S. McCamant, and M. D. Ernst. Dynamic inference of abstract types. In Proceedings of ISSTA 2006, pages 255--265, Portland, Maine, USA, July 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. R. Hastings and B. Joyce. Purify: Fast detection of memory leaks and access errors. In Proceedings of the Winter USENIX Conference, pages 125--136, San Francisco, California, USA, January 1992.Google ScholarGoogle Scholar
  9. K. Hazelwood. Code Cache Management in Dynamic Optimization Systems. PhD thesis, Harvard University, Cambridge, Mass., USA, May 2004.Google ScholarGoogle Scholar
  10. G. Lueck and R. Cohn. Personal communication, September-November 2006.Google ScholarGoogle Scholar
  11. C.-K. Luk, R. Cohn, R. Muth, H. Patil, A. Klauser, G. Lowney, S. Wallace, V. J. Reddi, and K. Hazelwood. Pin: Building customized program analysis tools with dynamic instrumentation. In Proceedings of PLDI 2005, pages 191--200, Chicago, Illinois, USA, June 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. J. Maebe, M. Ronsse, and K. De Bosschere. DIOTA: Dynamic instrumentation, optimization and transformation of applications. In Proceedings of WBT-2002, Charlottesville, Virginia, USA, September 2002.Google ScholarGoogle Scholar
  13. S. McCamant and M. D. Ernst. Quantitative information-flow tracking for C and related languages. Technical Report MIT--CSAIL--TR--2006--076, MIT, Cambridge, Mass., USA, 2006.Google ScholarGoogle Scholar
  14. S. Narayanasamy, C. Pereira, H. Patil, R. Cohn, and B. Calder. Automatic logging of operation system effects to guide application-level architecture simulation. In Proceedings of SIGMetrics/Performance 2006, pages 216--227, St. Malo, France, June 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. N. Nethercote. Dynamic Binary Analysis and Instrumentation. PhD thesis, University of Cambridge, United Kingdom, November 2004.Google ScholarGoogle Scholar
  16. N. Nethercote and J. Fitzhardinge. Bounds-checking entire programs without recompiling. In Informal Proceedings of SPACE 2004, Venice, Italy, January 2004.Google ScholarGoogle Scholar
  17. N. Nethercote and A. Mycroft. Redux: A dynamic dataflow tracer. ENTCS, 89(2), 2003.Google ScholarGoogle Scholar
  18. N. Nethercote and J. Seward. Valgrind: A program supervision framework. ENTCS, 89(2), 2003.Google ScholarGoogle Scholar
  19. N. Nethercote and J. Seward. How to shadow every byte of memory used by a program. In Proceedings of VEE 2007, San Diego, California, USA, June 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. J. Newsome and D. Song. Dynamic taint analysis for automatic detection, analysis, and signature generation of exploits on commodity software. In Proceedings of NDSS'05, San Diego, California, USA, February 2005.Google ScholarGoogle Scholar
  21. H. Patil and C. Fischer. Low-cost, concurrent checking of pointer and array accesses in C programs. Software-Practice and Experience, 27(1):87--110, January 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. F. Qin. Personal communication, March 2007.Google ScholarGoogle Scholar
  23. F. Qin, C. Wang, Z. Li, H. Kim, Y. Zhou, and Y. Wu. Lift: A low-oeverhead practical information flow tracking system for detecting security attacks. In Proceedings of the Annual IEEE/ACM International Symposium on Microarchitecture (Micro'06), Orlando, Florida, USA, December 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. K. Scott, J. W. Davidson, and K. Skadron. Low-overhead software dynamic translation. Technical Report CS-2001-18, University of Virginia, Charlottesville, Virginia, USA, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. J. Seward and N. Nethercote. Using Valgrind to detect undefined value errors with bit-precision. In Proceedings of the USENIX'05 Annual Technical Conference, Anaheim, California, USA, April 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. O. Traub, G. Holloway, and M. D. Smith. Quality and speed in linear-scan register allocation. In Proceedings of PLDI '98, pages 142--151, Montreal, Canada, June 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. The Valgrind Developers. 2nd official Valgrind survey, September 2005: full report. http://www.valgrind.org/gallery/survey_05/report.txt.Google ScholarGoogle Scholar
  28. The Valgrind Developers. Valgrind. http://www.valgrind.org/.Google ScholarGoogle Scholar
  29. L. Wall, T. Christiansen, and J Orwant. Programming Perl. O'Reilly, 3rd edition, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Valgrind: a framework for heavyweight dynamic binary instrumentation

        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

        Full Access

        • Published in

          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
          • 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

          Copyright © 2007 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: 10 June 2007

          Check for updates

          Qualifiers

          • article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader