Lune

POPL2021Top-tier venue

Optimal prediction of synchronization-preserving races

Umang Mathur, Andreas Pavlogiannis, Mahesh Viswanathan

2021Year
36Citations
17Top-tier citations

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.

Questions to start from

Your agent calls

Luneget_paper_fulltext

Ask in Lune

Free to start. No credit card required.

lune papers fulltext ce9683ac-c20f-4b67-a3b2-a6d59ca915aa

Cited by top-tier papers17

Ask how each one uses it

Builds on4

Related papers

Dusk over the sea between two cliffs drawn in fine vertical lines