Compiler Atomicity Violation Detection via Auxiliary Lock States

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current methods for detecting and tolerating atomicity violations in concurrent programming are inefficient, often resulting in unpredictable program behavior due to data races and synchronization issues, with existing approaches being either too slow or less precise, and often requiring extensive static analyses or hardware-centric solutions.

Innovation Solution

A dynamic approach that uses systematic data flow analysis and profiling-based filtering to detect and tolerate atomicity violations by inflating critical sections, coalescing neighboring sections, and introducing auxiliary lock states to distinguish between original and runtime lock acquisition and release points, thereby reducing false positives and improving synchronization.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If happens-before analysis is used to detect data races, then detection precision is improved, but execution speed deteriorates significantly

Engineering Contradiction:
Improvedata race detection precisionVSAvoidexecution speed
Core Design Contradiction:
Measurement precisionVSSpeed

Solution Approach 1:

The system performs preliminary static analysis to identify candidate critical sections and pre-computes happens-before relationships for potential race conditions. This preliminary action filters out obvious safe cases before dynamic execution, reducing the burden on runtime analysis while maintaining detection precision.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system applies happens-before analysis selectively to identified candidate regions rather than globally. By focusing analysis only on potentially problematic areas (excessive action on specific regions), the system achieves high detection precision without the full performance penalty of global analysis.

Inventive Principle:
Principle #16Partial or excessive action

2Speed

If lock set analysis is used to detect data races, then execution speed is improved, but detection precision deteriorates

Engineering Contradiction:
Improveexecution speedVSAvoiddata race detection precision
Core Design Contradiction:
SpeedVSMeasurement precision

Solution Approach 1:

The system merges lock set analysis (fast but imprecise) with happens-before analysis (precise but slow) into a hybrid approach. The lock set analysis provides quick filtering while happens-before analysis refines detection on candidate cases, achieving both speed and precision simultaneously.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The system introduces an intermediary static analysis phase that identifies candidate critical sections and potential race conditions. This intermediary layer guides the dynamic lock set analysis, improving its precision without sacrificing execution speed by focusing resources only on relevant regions.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Reliability

If critical sections are inflated by advancing lock acquisition and delaying lock release, then atomicity violation detection is improved, but program execution time increases

Engineering Contradiction:
Improveatomicity violation detectionVSAvoidprogram execution time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The system applies critical section inflation locally only to identified candidate regions where atomicity violations are suspected. By advancing lock acquisition and delaying lock release only in these specific local areas rather than globally, the system improves detection reliability while minimizing impact on overall execution time.

Inventive Principle:
Principle #3Local quality

4Reliability

If static inference of critical sections is used, then atomicity violations are avoided, but the approach is restricted to single define-use chains

Engineering Contradiction:
Improveatomicity violation preventionVSAvoidcritical section scope
Core Design Contradiction:
ReliabilityVSAdaptability or versatility

Solution Approach 1:

The system transitions from static to dynamic critical section inference. By using runtime profiling and data flow analysis to identify critical sections based on actual execution patterns rather than static code analysis, the system achieves both reliability in preventing atomicity violations and versatility in handling complex multi-define-use chain scenarios.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS8732682B2Systems and methods for detecting and tolerating atomicity violations between concurrent code blocks
Publication Date: 2014.05.20 ORACLE INT CORP
  • US8732682B2 patent drawing
  • US8732682B2 patent drawing
  • US8732682B2 patent drawing

AI summary

The system and methods described herein may be used to detect and tolerate atomicity violations between concurrent code blocks and/or to generate code that is executable to detect and tolerate such violations. A compiler may transform program code in which the potential for atomicity violations exists into alternate code that tolerates these potential violations. For example, the compiler may inflate critical sections, transform non-critical sections into critical sections, or coalesce multiple critical sections into a single critical section. The techniques described herein may utilize an auxiliary lock state for locks on critical sections to enable detection of atomicity violations in program code by enabling the system to distinguish between program points at which lock acquisition and release operations appeared in the original program, and the points at which these operations actually occur when executing the transformed program code. Filtering and analysis techniques may reduce false positives induced by the transformations.