Reverse Execution With Constraint Solving

The typical debugging experience is an iterative process of setting breakpoints, running the program and inspecting the state until the source of the bug is identified. When re-executing the program is not guaranteed to reproduce the faulty execution path, the final state and the system logs can be used to mentally construct a model of the execution. By contrast, debugging by going backward in time, i.e. the ability to reverse-execute the program, can be considered the most intuitive and easy-to-use alternative. We show an efficient approach to reverse execution, which sacrifices the full replay ability in favor of portability and a lighter memory footprint. We treat the execution trace as a set of constraints, and use an SMT solver to navigate the trace and restore data values. Depending on how the solver performs on constraint sets corresponding to multiple test runs, we decide where to instrument the code to save intermediate values, for a faster replay.

[1]  Robert Glück,et al.  Reversible Flowchart Languages and the Structured Reversible Program Theorem , 2008, ICALP.

[2]  Yasushi Saito,et al.  Jockey: a user-space library for record-replay debugging , 2005, AADEBUG'05.

[3]  Yuanyuan Zhou,et al.  PRES: probabilistic replay with execution sketching on multiprocessors , 2009, SOSP '09.

[4]  Charles H. Bennett,et al.  Logical reversibility of computation , 1973 .

[5]  Alan Bundy,et al.  Constructing Induction Rules for Deductive Synthesis Proofs , 2006, CLASE.

[6]  Niklas Sörensson,et al.  An Extensible SAT-solver , 2003, SAT.

[7]  Simon B. Jones,et al.  Walk Backwards to Happiness - Debugging by Time Travel , 1997, AADEBUG.

[8]  Sumit Gulwani,et al.  Path-based inductive synthesis for program inversion , 2011, PLDI '11.

[9]  Charles H. Bennett Time/Space Trade-Offs for Reversible Computation , 1989, SIAM J. Comput..

[10]  Jon Howell,et al.  Mugshot: Deterministic Capture and Replay for JavaScript Applications , 2010, NSDI.

[11]  Scott Shenker,et al.  Replay debugging for distributed applications , 2006 .

[12]  Rajib Mall,et al.  Reverse execution of programs , 1999, SIGP.

[13]  Tankut Akgul Assembly instruction level reverse execution for debugging , 2004, TSEM.

[14]  Michael D. Ernst,et al.  HAMPI: a solver for string constraints , 2009, ISSTA.

[15]  Xuezheng Liu,et al.  Usenix Association 8th Usenix Symposium on Operating Systems Design and Implementation R2: an Application-level Kernel for Record and Replay , 2022 .

[16]  Robert H. B. Netzer,et al.  Optimal tracing and incremental reexecution for debugging long-running programs , 1994, PLDI '94.

[17]  Robert Glück,et al.  Revisiting an automatic program inverter for Lisp , 2005, SIGP.

[18]  Paul R. Wilson,et al.  Demonic memory for process histories , 1989, PLDI '89.

[19]  Brian J. Ross,et al.  Running programs backwards: The logical inversion of imperative computation , 1997, Formal Aspects of Computing.

[20]  Jooyong Lee Dynamic Reverse Code Generation for Backward Execution , 2007 .

[21]  Samuel T. King,et al.  Debugging Operating Systems with Time-Traveling Virtual Machines (Awarded General Track Best Paper Award!) , 2005, USENIX Annual Technical Conference, General Track.

[22]  Jonathan J. Cook Reverse Execution of Java Bytecode , 2002, Comput. J..

[23]  James R. Larus,et al.  Optimally profiling and tracing programs , 1994, TOPL.

[24]  Robert Glück,et al.  Principles of a reversible programming language , 2008, CF '08.

[25]  Robert Glück,et al.  A Program Inverter for a Functional Language with Equality and Constructors , 2003, APLAS.

[26]  Andrew W. Appel,et al.  Debugging standard ML without reverse engineering , 1990, LISP and Functional Programming.

[27]  Tetsuo Yokoyama,et al.  Reversible Computation and Reversible Programming Languages , 2010, RC@ETAPS.

[28]  Richard M. Fujimoto,et al.  Source-code Transformations for Efficient Reversibility , 1999 .

[29]  Ion Stoica,et al.  ODR: output-deterministic replay for multicore debugging , 2009, SOSP '09.

[30]  Bob Boothe Efficient algorithms for bidirectional debugging , 2000, PLDI '00.

[31]  David Lie,et al.  Relaxed Determinism: Making Redundant Execution on Multiprocessors Practical , 2007, HotOS.

[32]  Rok Sosic,et al.  History cache: hardware support for reverse execution , 1994, CARN.

[33]  Santosh Pande,et al.  A fast assembly level reverse execution method via dynamic slicing , 2004, Proceedings. 26th International Conference on Software Engineering.