AVIO: Detecting Atomicity Violations via Access Interleaving Invariants ASPLOS’06
Download
Report
Transcript AVIO: Detecting Atomicity Violations via Access Interleaving Invariants ASPLOS’06
AVIO: Detecting Atomicity Violations
via Access Interleaving Invariants
Shan Lu, Joseph Tucek, Feng Qin and Yuanyuan Zhou @ UIUC
ASPLOS’06
Presented by Jie Xiao
March 17, 2008
Outline
Motivation
AVIO solution
AVIO Implementations
Evaluation
Conclusions
Motivation
Concurrency bugs – difficult to test and
diagnose
Increasing Concurrency bugs – SMT
and CMP encourage multi-threaded
programming
Previous work – not satisfying
Motivation
Previous work (1) – data races
Lamport’s Happens-before Algorithm
A data race bug is reported when two
conflicting memory access do not have a
strict happen-before relation.
Lockset Algorithm (Eraser)
Motivation
Programmers want atomicity, not just
freedom from data races
Race-free does NOT ensure synchronization correctness!
Motivation
A data race is not always a bug.
Barriers
Flag synchronization
Previous work can’t differentiate benign
races from true bugs.
Previous work has a high false positive.
Motivation
Previous work (2) – atomicity violations
Requires programmers’ annotations
Time-consuming
Correctness ?
SVD: without programmers’ annotations
only detects a limited subset of atomicity
violation bugs.
AVIO solution
AVIO: an invariant-based approach
Access-Interleaving (AI) Invariant
AVIO solution
Two steps:
Collect AI Invariants through training
Detect AI Invariants violation at run time
Analyze interleaving (Table 1)
8 ways of interleaving
4 of them are violations: case 2, 3, 5, 6.
AVIO solution
Case 2
AVIO
Step two – Detection Algorithm
AVIO solution
Step one – Extraction Algorithm
Based on Detection Algorithm
In-house testing
Delete fake AI invariants
Run several times with the same input
AVIO Implementations
AVIO-H
Using existing invalidation-based cache
coherence protocol
AVIO Implementations
AVIO-S
Each thread has an access-table.
More accurate, slower, cheaper
Evaluation
AVIO detects more atomicity violation bugs.
AVIO doesn’t rely on synchronization primitives.
AVIO is based on interleaving analysis.
Evaluation
AVIO has less false positives
AVIO-S is more accurate than AVIO-H, because
AVIO-S can choose flexible granularity.
Evaluation
AVIO has small overhead
AVIO-S for in-house bug detection and
postmortem bug diagnosis.
AVIO-H for bug detection during production runs.
Conclusions
AVIO is effective in detecting atomicity violations.
Detect more atomicity violations than previous
approaches
Low false positive
The first approach using hardware support to detect
atomicity violation
AVIO-H has a low overhead
Doesn’t rely on programmers’ annotations