Backwards Debugging Multithreaded Programs Shared Memory

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional debuggers are unable to perform backwards debugging, especially in cases of non-deterministic events, and struggle with multithreaded programs and shared memory access, leading to difficulties in tracing errors and debugging programs without access to source code or when compiler issues are involved.

Innovation Solution

A method that involves instrumenting machine code to handle non-deterministic events, recording states, and replaying execution to return to arbitrary points in a program's history, using techniques like thread multiplexing, snapshotting, and shared memory management to handle thread switches, asynchronous events, and shared memory access.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If forward debugging with breakpoints is used, then the program can be examined at specific points, but the cause of errors occurring long before manifestation cannot be identified

Engineering Contradiction:
Improveerror detection precisionVSAvoidtime to identify error cause
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent applies preliminary action by recording program states and execution information before errors occur. The system continuously captures snapshots of program state, register values, and instruction execution sequences during normal forward execution, so that when an error is detected, the pre-recorded information is already available for immediate analysis without requiring time-consuming backward reconstruction.

Inventive Principle:
Principle #10Preliminary action

2Quantity of substance

If backwards debugging is implemented without recording intermediate results, then memory usage is reduced, but it becomes impossible to return to previous program states

Engineering Contradiction:
Improvememory consumptionVSAvoidbackward execution capability
Core Design Contradiction:
Quantity of substanceVSAdaptability or versatility

Solution Approach 1:

The patent applies local quality by selectively recording only the essential program state information needed for backward debugging, rather than recording all possible data. Specifically, it records snapshots of program state at instruction boundaries, register values, and execution sequences, while omitting redundant information. This localized recording strategy enables backward execution capability while keeping memory consumption manageable.

Inventive Principle:
Principle #3Local quality

3Ease of operation

If conventional debugging methods are used on multithreaded programs with shared memory, then debugging is simpler, but non-deterministic events like thread switches and shared memory reads cannot be properly handled

Engineering Contradiction:
Improvedebugging simplicityVSAvoiddebugging accuracy for non-deterministic events
Core Design Contradiction:
Ease of operationVSReliability

Solution Approach 1:

The patent applies the intermediary principle by introducing a recording mechanism that acts as a mediator between the non-deterministic multithreaded program execution and the debugging process. The system records thread switch events, shared memory access patterns, and execution sequences during forward execution, creating a deterministic replay trace. This intermediary recording layer allows conventional simple debugging operations to work reliably on complex multithreaded programs by providing a controlled replay of the original execution.

Inventive Principle:
Principle #24Intermediary (Mediator)

4Loss of information

If source code instrumentation is used for debugging, then debugging information can be obtained, but it becomes impossible to debug programs without source code access or when compiler issues are involved

Engineering Contradiction:
Improvedebugging information availabilityVSAvoidcompatibility with compiled-only programs
Core Design Contradiction:
Loss of informationVSAdaptability or versatility

Solution Approach 1:

The patent applies mechanics substitution by replacing source code-level instrumentation with machine code-level recording. Instead of inserting debug statements into source code, the system directly records execution information from the compiled machine code, including instruction sequences, register states, and memory accesses. This substitution allows the debugging system to work with compiled programs without requiring source code access, while still obtaining comprehensive debugging information at the binary level.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Data Source

PatentEP2600252B1System and method for debugging of computer programs
Publication Date: 2019.04.03 UNDO
  • EP2600252B1 patent drawingFigure 1
  • EP2600252B1 patent drawingFigure 2
  • EP2600252B1 patent drawingFigure 3

AI summary

We describe techniques which relate to bi-directional, in particular backwards, debugging of computer programs. Thus we describe identifying processes with shared memory access, such as threads or multicore processes, by arranging process (thread) memory ownership to deliberate provoke memory page faults to identify and handle concurrent memory access by multiple threads in such a manner as to enable deterministic replay, and hence backwards debugging.