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.
CCS Concepts: • Software and its engineering → Software verification and validation; • Theory of computation → Theory and algorithms for application domains; Program analysis.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext ce9683ac-c20f-4b67-a3b2-a6d59ca915aaCited 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
- Reduce Dependence for Sound Concurrency Bug PredictionShihao Zhu, Yuqi Guo, Yan Cai, Bin Liang et al.ICSE 2025 · 1 citation
- Accurate Static Data Race Detection for CEmerson Sales, Omar Inverso, Emilio TuostoFM 2024 · 1 citation
