REPT: Reverse Debugging of Failures in Deployed Software

REPT: Reverse Debugging of Failures in Deployed Software

REPT: Reverse Debugging of Failures in Deployed Software Weidong Cui and Xinyang Ge, Microsoft Research Redmond; Baris Kasikci, University of Michigan; Ben Niu, Microsoft Research Redmond; Upamanyu Sharma, University of Michigan; Ruoyu Wang, Arizona State University; Insu Yun, Georgia Institute of Technology https://www.usenix.org/conference/osdi18/presentation/weidong This paper is included in the Proceedings of the 13th USENIX Symposium on Operating Systems Design and Implementation (OSDI ’18). October 8–10, 2018 • Carlsbad, CA, USA ISBN 978-1-939133-08-3 Open access to the Proceedings of the 13th USENIX Symposium on Operating Systems Design and Implementation is sponsored by USENIX. REPT: Reverse Debugging of Failures in Deployed Software Weidong Cui1, Xinyang Ge1, Baris Kasikci2, Ben Niu1, Upamanyu Sharma2, Ruoyu Wang3, and Insu Yun4 1Microsoft Research 2University of Michigan 3Arizona State University 4Georgia Institute of Technology Abstract logging/tracing when most logs or traces would be dis- carded for normal runs. As a result, only a memory dump Debugging software failures in deployed systems is im- is captured upon failures in deployed software to enable portant because they impact real users and customers. post-mortem diagnosis. However, debugging such failures is notoriously hard in Alas, it is challenging for developers to debug memory practice because developers have to rely on limited infor- dumps due to limited information. The result is that a mation such as memory dumps. The execution history is significant fraction of bugs is left unfixed [32,59]. Those usually unavailable because high-fidelity program trac- that get fixed can take weeks in certain cases [32]. ing is not affordable in deployed systems. To make matters worse, streamlined software pro- In this paper, we present REPT, a practical system cesses call for short release cycles [53], which limits that enables reverse debugging of software failures in the extent of in-house testing prior to software release. deployed systems. REPT reconstructs the execution his- Frequent releases increase the dependency on debugging tory with high fidelity by combining online lightweight failures reported from deployed software, because these hardware tracing of a program’s control flow with of- failure occurrences become the only way to detect cer- fline binary analysis that recovers its data flow. It is tain bugs. Frequent releases also increase the demand for seemingly impossible to recover data values thousands quickly resolving bugs to meet short release deadlines. of instructions before the failure due to information loss and concurrent execution. REPT tackles these challenges There exists a rich literature on debugging failures, by constructing a partial execution order based on time- which can roughly be classified into two categories: stamps logged by hardware and iteratively performing (1) Automatic root cause diagnosis [16, 37–41, 61] at- forward and backward execution with error correction. tempts to automatically determine the culprit statements We design and implement REPT, deploy it on Mi- that cause a program to fail. Due to various limitations crosoft Windows, and integrate it into WinDbg. We eval- (e.g., requiring code modification [37, 40, 41], inabil- uate REPT on 16 real-world bugs and show that it can ity to handle complex software efficiently [37, 61], or recover data values accurately (92% on average) and ef- being limited to a subset of failures [37, 39]), none of ficiently (in less than 20 seconds) for these bugs. We these systems are deployed in practice. Moreover, even also show that it enables effective reverse debugging for though root cause diagnosis can help a developer deter- 14 bugs. mine the reasons behind a failure, developers often re- quire a deeper understanding of the conditions and the state leading to a failure to fix a bug, which these sys- 1 Introduction tems do not provide. (2) Failure reproduction for debugging attempts to en- Software failures in deployed systems are unavoidable able developers to examine program inputs and state that and debugging such failures is crucial because they im- lead to failures. Exhaustive testing techniques such as pact real users and customers. It is well known that ex- symbolic execution [22] and model checking [21, 58], ecution logs are helpful for debugging [28], but nobody or state-space exploration [51] can be used to determine wants to pay a high performance overhead for always-on inputs and state that lead to a failure for the purpose USENIX Association 13th USENIX Symposium on Operating Systems Design and Implementation 17 of debugging. Unfortunately, these techniques require low runtime monitoring overhead and should finish its heavyweight runtime monitoring [26]. Another popular analysis within minutes. To solve this challenge, we in- technique for reproducing failures is record/replay sys- troduce a new binary analysis approach that combines tems [46, 48, 50, 52, 56] that record program executions forward and backward execution to iteratively emulate that can later be replayed to debug failures. This is also instructions and recover data values. REPT uses the fol- known as reverse debugging [31, 55] or time-travel de- lowing two new techniques for its analysis: bugging [44]. On the plus side, reverse debugging allows a developer to go back and forth in a failed execution to First, we design an error correction scheme to detect examine a program’s state (i.e., control and data flow) to and correct value conflicts that are introduced by mem- truly understand the bug and devise a fix. On the other ory writes to unknown addresses. When emulating a hand, record/replay systems incur prohibitive overhead memory write instruction, it is too conservative to mark (up to 200% for the state-of-the-art system [56]) in mul- all memory values as unknown if the destination address tithreaded programs running on multiple cores, making is unknown. Instead, REPT leaves memory untouched them impractical for use in deployed systems. and relies on detecting a conflict later caused by stale val- Due to the limitations of existing techniques, major ues in the destination memory. Unlike previous solutions software vendors including Apple [17], Google [33], and that use expensive hypothesis tests to decide memory Microsoft [30] as well as open-source systems such as aliases [57], the error correction scheme enables REPT Ubuntu [54] operate error reporting services to collect to run its iterative analysis efficiently. data about failures in deployed software and analyze Second, we leverage the timing information pro- them. To our knowledge, even the most advanced bug vided by modern hardware to determine the order of diagnosis system deployed in production, namely RE- non-deterministic events such as races across multiple Tracer [27], is only able to triage failures caused by ac- threads. Non-determinism has been a long-standing cess violations. challenge that hinders the ability of existing record/re- To solve the challenge of debugging software failures play systems to achieve high accuracy with low over- in deployed systems, we argue that we need a practical head. REPT can identify the order of accesses to solution that enables reverse debugging of such failures. the same memory location in most cases by using To be practical, the solution must (1) impose a very low fine-grained timestamps that modern hardware provides. runtime performance overhead when running on a de- When the timing information is not enough, REPT re- ployed system, (2) should be able to recover the execu- stricts the use of memory accesses whose order cannot tion history accurately and efficiently, (3) work with un- be inferred. This stops their values from negatively af- modified source code/binary, (4) apply to broad classes fecting the recovery of other data. of bugs (e.g., concurrency bugs). In this paper, we present REPT1, a practical solution We implement REPT in two components. The online for reverse debugging of software failures in deployed tracing component is a driver that controls Intel Proces- systems. There are two key ideas behind REPT. First, sor Trace (PT) [36], and has been deployed on hundreds REPT leverages hardware tracing to record a program’s of millions of machines as part of Microsoft Windows. control flow with low performance overhead. Second, The offline binary analysis component is a loadable li- REPT uses a novel binary analysis technique to recover brary that is integrated into WinDbg [45]. We also en- data flow information based on the logged control flow hance Windows Error Reporting (WER) service [30] to information and the data values saved in a memory control hardware tracing on deployed systems. dump. Consequently, REPT enables reverse debugging by combining the logged control flow and the recovered To measure the effectiveness and efficiency of REPT, data flow. we evaluate it on 16 real-world bugs in software such The main challenge faced by REPT is how to accu- as Chrome, Apache, PHP, and Python. Our experiments rately and efficiently recover data values based on the show that REPT can enable effective reverse debugging logged control flow and the data values saved in the for 14 of them, including 2 concurrency bugs. We evalu- memory dump. To be accurate, REPT must be able to ate REPT’s data recovery accuracy by comparing its re- correctly recover a significant fraction of data values in covered data values with those logged by Time Travel the execution history. To be efficient, REPT must incur Debugging (TTD) [44], a slow but precise record/replay tool. Our experiments show that REPT can achieve an 1REPT stands for Reverse Execution with Processor Trace and average accuracy of 92% and finish its analysis in less reads as “repeat.” than 20 seconds for these bugs. 18 13th USENIX Symposium on Operating Systems Design and Implementation USENIX Association 2 Overview concrete ones. As the program executes, symbolic ex- ecution gathers constraints on symbolic values.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    17 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us