The Complexity of Dynamic Data Race Prediction

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

Writing concurrent programs is notoriously hard due to scheduling non-determinism. The most common concurrency bugs are data races, which are accesses to a shared resource that can be executed concurrently. Dynamic data-race prediction is the most standard technique for detecting data races: given an observed, data-race-free trace t, the task is to determine whether t can be reordered to a trace t^* that exposes a data-race. Although the problem has received significant practical attention for over three decades, its complexity has remained elusive. In this work, we address this lacuna, identifying sources of intractability and conditions under which the problem is efficiently solvable. Given a trace t of size n over k threads, our main results are as follows. First, we establish a general O(k· n^2· (k-1)) upper-bound, as well as an O(n^k) upper-bound when certain parameters of t are constant. In addition, we show that the problem is NP-hard and even W[1]-hard parameterized by k, and thus unlikely to be fixed-parameter tractable. Second, we study the problem over acyclic communication topologies, such as server-clients hierarchies. We establish an O(k^2· d· n^2·log n) upper-bound, where d is the number of shared variables accessed in t. In addition, we show that even for traces with k=2 threads, the problem has no O(n^2-ϵ) algorithm under Orthogonal Vectors. Since any trace with 2 threads defines an acyclic topology, our upper-bound for this case is optimal wrt polynomial improvements for up to moderate values of k and d. Finally, we study a distance-bounded version of the problem, where the task is to expose a data race by a witness trace that is similar to t. We develop an algorithm that works in O(n) time when certain parameters of t are constant.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
10/30/2020

Optimal Prediction of Synchronization-Preserving Races

Concurrent programs are notoriously hard to write correctly, as scheduli...
research
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...
research
01/25/2019

Fast, Sound and Effectively Complete Dynamic Race Detection

Writing concurrent programs is highly error-prone due to the nondetermin...
research
07/24/2019

An FPT algorithm for orthogonal buttons and scissors

We study the puzzle game Buttons and Scissors in which the goal is to re...
research
07/23/2022

Average-Case to (shifted) Worst-Case Reduction for the Trace Reconstruction Problem

The insertion-deletion channel takes as input a binary string x ∈{0, 1}^...
research
07/25/2020

Bounding the trace function of a hypergraph with applications

An upper bound on the trace function of a hypergraph H is derived and it...
research
04/19/2019

Data Races and the Discrete Resource-time Tradeoff Problem with Resource Reuse over Paths

A determinacy race occurs if two or more logically parallel instructions...

Please sign up or login with your details

Forgot password? Click here to reset