Detecting Unread Memory Using Dynamic Binary Translation

  • Jon Eyolfson
  • Patrick Lam
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7687)

Abstract

Reading from uninitialized memory—that is, reading from memory before it has been written to—is a well-known memory usage error, and many static and dynamic tools verify that programs always write to memory before reading it. This work investigates the converse behaviour—writes that never get read, which we call “unread writes”. Such writes are redundant—at best, they do not perform any useful work; furthermore, work done to compute the values to be written could corrupt the program state or cause a crash. We present a novel dynamic analysis, implemented on top of the Pin dynamic binary translation framework, which detects instances of unread writes at runtime. We have implemented our analysis and present experimental data about the prevalence of unread writes in a set of benchmark applications.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Nethercote, N., Seward, J.: Valgrind: a framework for heavyweight dynamic binary instrumentation. In: Proceedings of the ACM SIGPLAN 2007 Conference on Programming Language Design and Implementation (PLDI 2007), pp. 89–100. ACM Press, San Diego (2007)CrossRefGoogle Scholar
  2. 2.
    Hastings, R., Joyce, B.: Purify: Fast detection of memory leaks and access errors. In: Proc. of the Winter 1992 USENIX Conference, pp. 125–138 (1991)Google Scholar
  3. 3.
    Luk, C.K., Cohn, R., Muth, R., Patil, H., Klauser, A., Lowney, G., Wallace, S., Reddi, V.J., Hazelwood, K.: Pin: Building customized program analysis tools with dynamic instrumentation. In: PLDI 2005, Chicago, IL, USA, pp. 190–200 (June 2005)Google Scholar
  4. 4.
    Ding, C., Kennedy, K.: The memory bandwidth bottleneck and its amelioration by a compiler. In: IPDPS, pp. 181–190. IEEE Computer Society (2000)Google Scholar
  5. 5.
    Bala, V., Duesterwald, E., Banerjia, S.: Dynamo: a transparent dynamic optimization system. In: PLDI 2000, pp. 1–12. ACM, New York (2000)CrossRefGoogle Scholar
  6. 6.
    Fahs, B., Bose, S., Crum, M., Slechta, B., Spadini, F., Tung, T., Patel, S.J., Lumetta, S.S.: Performance characterization of a hardware mechanism for dynamic optimization. In: MICRO 34, pp. 16–27. IEEE Computer Society, Washington, DC (2001)Google Scholar
  7. 7.
    Arnold, M., Vechev, M.T., Yahav, E.: QVM: An efficient runtime for detecting defects in deployed systems. ACM Trans. Softw. Eng. Methodol. 21(1), 2 (2011)CrossRefGoogle Scholar
  8. 8.
    Bruening, D., Garnett, T., Amarasinghe, S.P.: An infrastructure for adaptive dynamic optimization. In: CGO 2003, San Francisco, CA, pp. 265–275 (March 2003)Google Scholar
  9. 9.
    Fowler, M., Beck, K.: Refactoring: improving the design of existing code. Addison-Wesley Professional (1999)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  • Jon Eyolfson
    • 1
  • Patrick Lam
    • 1
  1. 1.University of WaterlooCanada

Personalised recommendations