Deterministic Replay Debugging for Non-Deterministic Software Bugs
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Debugging intermittent and non-reproducible bugs in computer programs is challenging due to their intermittent nature, making it difficult to identify and correct the cause of issues like program slowness, as existing methods require extensive instrumentation and guesswork, and fail to capture unusual combinations of circumstances.
Innovation Solution
The method involves generating an instrumented version of machine code to capture and replay non-deterministic events, allowing for deterministic replay and reverse search to identify the source of errors, including logging and analyzing register and memory changes, and constructing a function-call graph to trace data flow and security validation.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If extensive instrumentation is used to capture program execution details, then debugging information completeness is improved, but program execution speed deteriorates
Solution Approach 1:
The patent segments the debugging process into two distinct phases: a recording phase that captures execution details, and a replay phase that analyzes them. This segmentation allows the program to be instrumented only during recording, not during normal execution or replay, thereby maintaining execution speed while still gathering comprehensive debugging information.
Solution Approach 2:
The patent performs preliminary action by capturing and storing execution details during an initial recording phase before analysis is needed. This preliminary capture of register values, memory states, and instruction sequences allows subsequent replay and analysis to proceed without additional instrumentation overhead, preserving execution speed during the actual debugging analysis.
2Difficulty of detecting and measuring
If program instrumentation is performed to capture execution details, then bug detection capability is improved, but device complexity increases
Solution Approach 1:
The patent creates a copy of the program's execution state (register values, memory contents, instruction sequences) during the recording phase. This copying approach allows comprehensive bug detection capability through detailed state capture without permanently modifying the program structure or requiring complex instrumentation to persist through multiple execution phases.
Solution Approach 2:
The patent introduces an intermediary recording mechanism that captures execution details without requiring the program itself to be complexly instrumented. The recorder acts as a mediator between the program execution and the analysis process, simplifying the overall system architecture by centralizing the instrumentation logic in a separate component rather than embedding it throughout the program.
3Measurement precision
If extensive details of program operation are captured during execution, then analysis accuracy is improved, but loss of time increases
Solution Approach 1:
The patent employs periodic action by capturing execution details at specific intervals or at key events during the recording phase, rather than continuously monitoring every aspect of execution. This periodic sampling approach maintains analysis accuracy for replay while reducing the overall data capture burden and associated time loss during the recording phase.
Solution Approach 2:
The patent applies skipping by rapidly capturing execution details during the recording phase and then skipping ahead to the replay phase where analysis occurs. This rushing through the recording process with efficient capture mechanisms minimizes the time lost to instrumentation overhead, while the captured details remain sufficient for accurate subsequent analysis.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
We describe a method of generating program analysis data for analysing the operation of a computer program, the method comprising: running a first instrumented version of machine code representing the program, wherein said running defines a reference execution of said program; capturing a log of non-deterministic events during said reference execution such that the machine code can be re-run in a deterministic manner to reproduce states of a processor and memory during the re-running; generating a second instrumented version of said machine code comprising instrumented machine code to replay execution of said machine code representing the program and to capture and store program state information during said replayed execution, wherein said program state information comprises one or both of one or more values of registers of said processor and one or more values of memory locations used by said program; running said instrumented machine code whilst reproducing said non-deterministic events during said running to reproduce said reference execution; and capturing said program state information whilst reproducing said reference execution to generate said program analysis data.