Effective Sampling for Lightweight Data-Race Detection - Marino, Daniel; Musuvathi, Madan; Narayanasamy, Satish (2008)
Data races are one of the most common and subtle causes of pernicious concurrency bugs. Static techniques for preventing data races are overly conservative and do not scale well to large programs. Past research has produced several dynamic data race detectors that can be applied to large programs and are precise in the sense that they only report actual data races. However, these dynamic data race detectors incur a high performance overhead, slowing down a program's execution by an order of magnitude. In this paper we present FeatherLite, a very lightweight data race detector that samples and analyzes only selected portions of a program's execution. We show that it is possible to sample a multi-threaded program at a low frequency and yet find infrequently occurring data races. We implemented FeatherLite using Microsoft's Phoenix compiler. Our experiments with several Microsoft programs show that FeatherLite is able to find more than 75% of data races by sampling less than 5% of memory accesses in a given program execution.