Skip to main content
QUICK REVIEW

[Paper Review] A Particular Bug Trap: Execution Replay Using Virtual Machines

Oliver Oppitz|ArXiv.org|Oct 15, 2003
Parallel Computing and Optimization TechniquesComputer Science5 references5 citations
TL;DR

This paper proposes a practical, generic execution replay (ER) infrastructure for desktop systems using virtual machines, specifically User-Mode-Linux (UML), enabling unmodified application replay without instrumentation or recompilation. By leveraging hardware instruction counters and deterministic virtualization, it achieves accurate, replayable execution for debugging time-critical and multi-threaded software.

ABSTRACT

Execution-replay (ER) is well known in the literature but has been restricted to special system architectures for many years. Improved hardware resources and the maturity of virtual machine technology promise to make ER useful for a broader range of development projects. This paper describes an approach to create a practical, generic ER infrastructure for desktop PC systems using virtual machine technology. In the created VM environment arbitrary application programs will run and be replayed unmodified, neither instrumentation nor recompilation are required.

Motivation & Objective

  • To enable execution replay (ER) for general-purpose desktop software development, overcoming limitations of prior ER systems restricted to specialized architectures.
  • To address the challenge of deterministic replay in commodity PC systems by using virtual machine (VM) technology to isolate and record all non-deterministic inputs.
  • To demonstrate that a generic, non-invasive ER infrastructure is feasible on standard hardware using existing virtualization and hardware performance monitoring features.
  • To enable debugging of time-sensitive and multi-threaded applications by faithfully reproducing execution sequences with exact timing and input stimuli.

Proposed method

  • Utilizes User-Mode-Linux (UML), a lightweight virtual machine that runs Linux kernels and user-space binaries in user space, enabling full system virtualization without kernel modifications.
  • Employs hardware performance counters (e.g., on PowerPC MPC7441) to track retired instructions with high accuracy, enabling deterministic instruction-level replay.
  • Records all non-deterministic inputs—such as interrupts, system calls, and device I/O—via virtual device drivers and redirects them to replay handlers during execution.
  • Uses performance monitor interrupts triggered after a pre-recorded number of instructions to synchronize replay and simulate timing-sensitive events.
  • Adapts existing debuggers (e.g., gdb or kgdb) to operate from the host OS, allowing direct inspection of guest process state, register contents, and stack traces during replay.
  • Compensates for deterministic counter inaccuracies (e.g., one-instruction overcount on interrupt transitions) by subtracting known overheads, ensuring replay fidelity.

Experimental results

Research questions

  • RQ1Can execution replay be implemented on standard desktop systems using commodity virtual machine technology without requiring program or OS modifications?
  • RQ2How accurately can hardware performance counters (e.g., on x86 and PowerPC) track instruction execution for deterministic replay in a virtualized environment?
  • RQ3To what extent can virtual device drivers and performance monitor interrupts enable faithful recording and replay of system stimuli like interrupts and I/O?
  • RQ4Is it feasible to build a debugger that operates from the host OS to inspect and control processes running inside a replaying virtual machine?
  • RQ5Can the probe effect of recording be minimized by using hardware counters and stealthy background instrumentation?

Key findings

  • The PowerPC MPC7441 processor provides highly accurate instruction counters, with only a deterministic one-instruction overcount per interrupt transition, which can be corrected algorithmically.
  • x86 instruction counters (e.g., Pentium III, IV, AMD Athlon) are unreliable due to documented inaccuracies, rendering them unsuitable for precise replay without further compensation.
  • The Itanium processor lacks guaranteed counter accuracy, and no reliable testing was possible due to lack of documentation.
  • The UML virtual machine environment allows unmodified applications to run and be replayed faithfully, with no need for instrumentation or recompilation.
  • By using virtual device drivers and performance monitor interrupts, the system successfully records and replays all non-deterministic inputs, including interrupts and I/O.
  • A modified debugger (e.g., adapted gdb or kgdb) can inspect guest process state during replay by directly accessing the guest’s memory layout and register state from the host OS.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.