Optimal Prediction of Synchronization-Preserving Races

10/30/2020
by   Umang Mathur, et al.
0

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 O(𝒩) time and space, where 𝒩 is the length of the trace σ. Second, we show that the problem has a Ω(𝒩/log^2 𝒩) 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.

READ FULL TEXT
POST COMMENT

Comments

There are no comments yet.

Authors

page 1

page 2

page 3

page 4

04/30/2020

The Complexity of Dynamic Data Race Prediction

Writing concurrent programs is notoriously hard due to scheduling non-de...
07/08/2021

Dynamic Data-Race Detection through the Fine-Grained Lens

Data races are among the most common bugs in concurrency. The standard a...
01/25/2019

Fast, Sound and Effectively Complete Dynamic Race Detection

Writing concurrent programs is highly error-prone due to the nondetermin...
04/15/2020

Efficient, Near Complete and Often Sound Hybrid Dynamic Data Race Prediction (extended version)

Dynamic data race prediction aims to identify races based on a single pr...
10/06/2020

Static Race Detection for RTOS Applications

We present a static analysis technique for detecting data races in Real-...
09/07/2019

Predicting All Data Race Pairs for a Specific Schedule (extended version)

We consider the problem of data race prediction where the program's beha...
05/26/2019

Data Race Prediction for Inaccurate Traces

Happens-before based data race prediction methods infer from a trace of ...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.