Debugging and analyzing a snapshot of a crashed program's memory is far more difficult than working with a live program, because debuggers can no longer execute code to help make sense of the program state. We present an architecture that supports the restricted execution of ordinary code starting from the snapshot, as if the dead objects within it had been restored, but without access to their original external environment. We demonstrate the feasibility of this approach via an implementation for Java that does not require a custom virtual machine, show that it performs competitively with live execution, and use it to diagnose an unresolved memory leak in a mature mainstream application.
Debugging and analyzing a snapshot of a crashed program's memory is far more difficult than working with a live program, because debuggers can no longer execute code to help make sense of the program state. We present an architecture that supports the restricted execution of ordinary code starting from the snapshot, as if the dead objects within it had been restored, but without access to their original external environment. We demonstrate the feasibility of this approach via an implementation for Java that does not require a custom virtual machine, show that it performs competitively with live execution, and use it to diagnose an unresolved memory leak in a mature mainstream application.
To help analyze unexpected behaviour, programming language environments and tools are beginning to support high-fidelity recordings of program executions. Such recordings are typically low-level and difficult to work with directly. Debugging and analyzing these recordings is easier and more powerful if it is possible to simulate executing additional code in the past context of the recording. In prior work we proposed retroactive weaving, the process of evaluating aspects as if they were present during a past execution. This concept is intended as a general framework for introducing additional code and defining the semantics of executing it post-hoc.In this paper we express retroactive weaving as a transformation on aspect-oriented programming languages and their semantics. We demonstrate this transformation by applying it to a simple core aspect-oriented language, and through a definitional interpreter illustrate its interactions with first-class function values, mutable state, and external input and output. In particular a key concern of retroactive weavers is maintaining soundness: behaving consistently with the context of the past execution, and failing if missing information makes this impossible. Retroactive weavers may need to include extra isolation or runtime checks to meet this requirement.
We present a novel approach to the problem of dynamic program analysis: writing analysis code directly into the program source, but evaluating it against a recording of the original program's execution. This approach allows developers to reason about their program in the familiar context of its actual source, and take full advantage of program semantics, data structures, and library functionality for understanding execution. It also gives them the advantage of hindsight, letting them easily analyze unexpected behavior after it has occurred. Our position is that writing offline analysis as retroactive aspects provides a unifying approach that developers will find natural and powerful.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.
customersupport@researchsolutions.com
10624 S. Eastern Ave., Ste. A-614
Henderson, NV 89052, USA
Copyright © 2024 scite LLC. All rights reserved.
Made with 💙 for researchers
Part of the Research Solutions Family.