Detecting Unread Memory Using Dynamic Binary Translation
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.
KeywordsMemory Access Memory Block Memory Allocation Execution Trace Watch Image
Unable to display preview. Download preview PDF.
- 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.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.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
- 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
- 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.Fowler, M., Beck, K.: Refactoring: improving the design of existing code. Addison-Wesley Professional (1999)Google Scholar