Optimal prediction of synchronization-preserving races
Umang Mathur, Andreas Pavlogiannis, Mahesh Viswanathan
Abstract
Concurrent programs are notoriously hard to write correctly, as scheduling nondeterminism introduces subtle errors that are both hard to detect and to reproduce. The most common concurrency errors are (data) races, which occur when memory-conflicting actions are executed concurrently. Consequently, considerable effort has been made towards developing efficient techniques for race detection. The most common approach is dynamic race prediction: given an observed, race-free trace 𝜎 of a concurrent program, the task is to decide whether events of 𝜎 can be correctly reordered to a trace 𝜎 * that witnesses a race hidden in 𝜎.
In this work we introduce the notion of sync(hronization)-preserving races. A sync-preserving race occurs in 𝜎 when there is a witness 𝜎 * in which synchronization operations (e.g., acquisition and release of locks) appear in the same order as in 𝜎. This is a broad definition that strictly subsumes the famous notion of happens-before races. Our main results are as follows. First, we develop a sound and complete algorithm for predicting sync-preserving races. For moderate values of parameters like the number of threads, the algorithm runs in 𝑂 (N ) time and space, where N is the length of the trace 𝜎. Second, we show that the problem has a Ω(N /log 2 N ) space lower bound, and thus our algorithm is essentially time and space optimal. Third, we show that predicting races with even just a single reversal of two sync operations is NP-complete and even W[1]-hard when parameterized by the number of threads. Thus, sync-preservation characterizes exactly the tractability boundary of race prediction, and our algorithm is nearly optimal for the tractable side. Our experiments show that our algorithm is fast in practice, while sync-preservation characterizes races often missed by state-of-the-art methods.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
17 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- The Complexity of Dynamic Data Race Prediction cites Fast, sound, and effectively complete dynamic race prediction
- Sound Dynamic Deadlock Prediction in Linear Time cites The Complexity of Dynamic Data Race Prediction
- Sound Dynamic Deadlock Prediction in Linear Time cites Fast, sound, and effectively complete dynamic race prediction
- Sound Dynamic Deadlock Prediction in Linear Time cites SmartTrack: efficient predictive race detection
- Sound Dynamic Deadlock Prediction in Linear Time cites Atomicity Checking in Linear Time using Vector Clocks
- Sound Dynamic Deadlock Prediction in Linear Time cites Sound and efficient concurrency bug prediction
- Greybox Fuzzing for Concurrency Testing cites Sound Dynamic Deadlock Prediction in Linear Time
- Greybox Fuzzing for Concurrency Testing cites Fast, sound, and effectively complete dynamic race prediction
- Greybox Fuzzing for Concurrency Testing cites SmartTrack: efficient predictive race detection
- Greybox Fuzzing for Concurrency Testing cites Atomicity Checking in Linear Time using Vector Clocks
- Greybox Fuzzing for Concurrency Testing cites Predictive Monitoring against Pattern Regular Languages
- SmartTrack: efficient predictive race detection cites Fast, sound, and effectively complete dynamic race prediction
- Predictive Monitoring against Pattern Regular Languages cites The Complexity of Dynamic Data Race Prediction
- Predictive Monitoring against Pattern Regular Languages cites Sound Dynamic Deadlock Prediction in Linear Time
- Predictive Monitoring against Pattern Regular Languages cites Fast, sound, and effectively complete dynamic race prediction
- Predictive Monitoring against Pattern Regular Languages cites SmartTrack: efficient predictive race detection
- Predictive Monitoring against Pattern Regular Languages cites Atomicity Checking in Linear Time using Vector Clocks
- Predictive Monitoring against Pattern Regular Languages cites Sound and efficient concurrency bug prediction
- Sound and efficient concurrency bug prediction cites Fast, sound, and effectively complete dynamic race prediction
- Optimal Reads-From Consistency Checking for C11-Style Memory Models cites The Complexity of Dynamic Data Race Prediction
- Optimal Reads-From Consistency Checking for C11-Style Memory Models cites Fast, sound, and effectively complete dynamic race prediction
Cited by top-tier papers17
- Sound and efficient concurrency bug predictionYan Cai, Hao Yun, Jinqiu Wang, Lei Qiao et al.FSE 2021 · 29 citations
- Greybox Fuzzing for Concurrency TestingDylan Wolff, Zheng Shi, Gregory J. Duck, Umang Mathur et al.ASPLOS 2024 · 19 citations
- Sound Dynamic Deadlock Prediction in Linear TimeHünkar Can Tunç, Umang Mathur, Andreas Pavlogiannis, Mahesh ViswanathanPLDI 2023 · 15 citations
- Predictive Monitoring against Pattern Regular LanguagesZhendong Ang, Umang MathurPOPL 2024 · 12 citations
- Optimal Reads-From Consistency Checking for C11-Style Memory ModelsHünkar Can Tunç, Parosh Aziz Abdulla, Soham Chakraborty, Shankaranarayanan Krishna et al.PLDI 2023 · 12 citations
Builds on4
- Fast, sound, and effectively complete dynamic race predictionAndreas PavlogiannisPOPL 2020 · 46 citations
- SmartTrack: efficient predictive race detectionJake Roemer, Kaan Genç, Michael D. BondPLDI 2020 · 28 citations
- The Complexity of Dynamic Data Race PredictionUmang Mathur, Andreas Pavlogiannis, Mahesh ViswanathanLICS 2020 · 27 citations
- Atomicity Checking in Linear Time using Vector ClocksUmang Mathur, Mahesh ViswanathanASPLOS 2020 · 27 citations
Related papers
- Optimistic Prediction of Synchronization-Reversal Data RacesZheng Shi, Umang Mathur, Andreas PavlogiannisICSE 2024 · 8 citations
- Predictive Monitoring with Strong Trace PrefixesZhendong Ang, Umang MathurCAV 2024 · 3 citations
- Dynamic Race Detection with O(1) SamplesMosaad Al Thokair, Minjian Zhang, Umang Mathur, Mahesh ViswanathanPOPL 2023 · 9 citations
- Accurate Static Data Race Detection for CEmerson Sales, Omar Inverso, Emilio TuostoFM 2024 · 1 citation
- Efficient Timestamping for Sampling-Based Race DetectionMinjian Zhang, Daniel Wee Soong Lim, Mosaad Al Thokair, Umang Mathur et al.PLDI 2025 · 1 citation
