Deterministic Replay Debugging for Non-Deterministic Software Bugs

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering 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

Engineering Contradiction:
Improvedebugging information completenessVSAvoidprogram execution speed
Core Design Contradiction:
Measurement precisionVSSpeed

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.

Inventive Principle:
Principle #1Segmentation

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.

Inventive Principle:
Principle #10Preliminary action

2Difficulty of detecting and measuring

If program instrumentation is performed to capture execution details, then bug detection capability is improved, but device complexity increases

Engineering Contradiction:
Improvebug detection capabilityVSAvoidinstrumentation complexity
Core Design Contradiction:
Difficulty of detecting and measuringVSDevice complexity

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.

Inventive Principle:
Principle #26Copying

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.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Measurement precision

If extensive details of program operation are captured during execution, then analysis accuracy is improved, but loss of time increases

Engineering Contradiction:
Improveanalysis accuracyVSAvoiddebugging time
Core Design Contradiction:
Measurement precisionVSLoss of time

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.

Inventive Principle:
Principle #19Periodic action

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.

Inventive Principle:
Principle #21Skipping (Rushing through)

Data Source

PatentEP3093768B1Debugging systems
Publication Date: 2021.09.08 UNDO
  • EP3093768B1 patent drawingFigure 1
  • EP3093768B1 patent drawingFigure 2
  • EP3093768B1 patent drawingFigure 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.