The Complexity of Dynamic Data Race Prediction
Abstract
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 , the task is to determine whether can be reordered to a trace 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 of size over threads, our main results are as follows. First, we establish a general upper-bound, as well as an upper-bound when certain parameters of are constant. In addition, we show that the problem is NP-hard and even W[1]-hard parameterized by , 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 upper-bound, where is the number of shared variables accessed in . In addition, we show that even for traces with threads, the problem has no 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 and . 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 . We develop an algorithm that works in time when certain parameters of are constant.
Cite
@article{arxiv.2004.14931,
title = {The Complexity of Dynamic Data Race Prediction},
author = {Umang Mathur and Andreas Pavlogiannis and Mahesh Viswanathan},
journal= {arXiv preprint arXiv:2004.14931},
year = {2020}
}