Dynamic Invariant Checking in Parallel Programs

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Developing parallel software for multi-core processors is error-prone due to complexities in managing parallel scenarios, leading to issues like deadlocks, race conditions, atomicity, order, and visibility violations, which existing tools and methods, such as dynamic analysis and parallel assertions, are insufficient in detecting, especially for complex properties and architectures with weak memory models.

Innovation Solution

A method using dynamic instrumentation to specify and check invariants in parallel programs by intercepting memory accesses, recording relevant memory locations, and using a central data structure to manage invariant checks, allowing for the detection of fundamental errors and inconsistencies in shared data structures.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If dynamic analysis methods are used to detect errors in parallel programs, then basic errors like race conditions and deadlocks can be detected, but complex properties such as invariants cannot be checked

Engineering Contradiction:
Improveerror detection capabilityVSAvoidinvariant checking capability
Core Design Contradiction:
ReliabilityVSAdaptability or versatility

Solution Approach 1:

The patent introduces an intermediary component - a runtime verification system with instrumentation code that mediates between the parallel program execution and invariant checking. This intermediary intercepts memory accesses, tracks relevant locations, and evaluates invariants without requiring modifications to the original program logic, thus enabling complex property verification while maintaining program functionality.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent replaces manual verification methods and simple dynamic analysis with an automated runtime verification mechanism. Instead of relying on developers to manually check invariants or using basic dynamic analysis tools, the system automatically instruments the program, tracks memory accesses, and verifies complex invariant properties during execution, substituting mechanical verification processes with automated software-based validation.

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

2Reliability

If parallel assertions are used to specify properties, then complex concurrency bugs can be detected, but the approach requires compiler modifications that restrict practical application

Engineering Contradiction:
Improveconcurrency bug detectionVSAvoidimplementation complexity
Core Design Contradiction:
ReliabilityVSEase of manufacture

Solution Approach 1:

The patent extracts the invariant checking functionality from the compiler and implements it as a separate runtime verification system. Instead of requiring compiler modifications to embed assertion checking logic, the system extracts verification capabilities into standalone instrumentation code that runs alongside the parallel program, thereby reducing implementation complexity and improving practical applicability while maintaining concurrency bug detection capabilities.

Inventive Principle:
Principle #2Taking out (Extraction)

3Productivity

If existing dynamic analysis tools are used, then simple errors can be detected, but they are limited to relatively simple errors and cannot check complex invariants

Engineering Contradiction:
Improvedevelopment efficiencyVSAvoidinvariant verification accuracy
Core Design Contradiction:
ProductivityVSMeasurement precision

Solution Approach 1:

The patent implements a dynamic verification system that adapts during program execution. The instrumentation code dynamically identifies relevant memory locations based on actual execution paths, adjusts tracking based on thread interactions, and evaluates invariants in real-time. This dynamic approach enables the system to maintain high productivity by only tracking necessary state while achieving precise invariant verification accuracy that static analysis cannot provide.

Inventive Principle:
Principle #15Dynamics

4Adaptability or versatility

If invariants are specified as ordinary functions with runtime activation, then arbitrary invariants can be checked, but this requires intercepting and monitoring all memory accesses

Engineering Contradiction:
Improveinvariant specification flexibilityVSAvoidinstrumentation overhead
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent applies local quality by making the verification process selective rather than universal. The instrumentation code identifies and tracks only those memory locations that are actually relevant to the specified invariants, rather than monitoring all memory accesses uniformly. This localized approach reduces instrumentation overhead and device complexity while maintaining the flexibility to specify arbitrary invariants, as the system focuses computational resources only on relevant program states.

Inventive Principle:
Principle #3Local quality

Data Source

PatentEP3114569B1Method for checking invariants in parallel programs
Publication Date: 2019.11.27 SIEMENS AG
  • EP3114569B1 patent drawingFigure 1~2
  • EP3114569B1 patent drawingFigure 3
  • EP3114569B1 patent drawingFigure 4

AI summary

The invention substantially relates to a method for checking invariants in parallel programs using dynamic instrumentation. Invariants are provided in the source code as conventional functions and can be activated or deactivated by the user using functional requests. The program is instrumented prior to or during the execution of the program in order to allow an interception of an access to the main memory unit. The addresses of the memory locations on which an invariant is dependent are automatically recorded in order to allow a determination of changes to the addresses. A central data structure is provided and for each thread, the central data structure stores an invariant, the addresses of the memory locations on which the invariant is dependent, and a Boolean value which indicates whether the recording process is active. A corresponding library function is requested for each load command and each storage command by means of the instrumentation, said library function recording the respective addresses in the event of loading commands as long as the recording process is activated, and checking the respective invariants in the event of storage commands. The essential advantage of the method over conventional approaches is that any invariants relating to the state of a parallel program can be specified, whereby not just fundamental errors, such as a race condition and deadlocks, can be detected but also inconsistencies in commonly used data structures.