Dataflow Analysis for Concurrent Programs using Datarace Detection
Ravi Chugh, Jan W. Voung, Ranjit Jhala, and Sorin Lerner
PLDI 2008
[ paper
| slides ]
Dataflow analyses for concurrent programs differ from their
single-threaded counterparts in that they must account for shared
memory locations being overwritten by concurrent threads.
Existing dataflow analysis techniques for concurrent programs
typically fall at either end of a spectrum: at one end, the analysis conservatively
kills facts about all data that might possibly be shared by multiple
threads; at the other end, a precise thread-interleaving analysis
determines which data may be shared, and thus which dataflow facts
must be invalidated. The former approach can suffer from imprecision,
whereas the latter does not scale.
We present RADAR, a framework that automatically converts a
dataflow analysis for sequential programs into one that is correct for
concurrent programs.
RADAR uses a race detection engine to kill the dataflow facts,
generated and propagated by the sequential analysis,
that become invalid due to concurrent writes.
Our approach of factoring all reasoning about concurrency
into a race detection engine yields two benefits.
First, to obtain analyses for code using new concurrency
constructs, one need only design a suitable
race detection engine for the constructs.
Second, it gives analysis designers an easy way to tune the
scalability and precision of the overall analysis by only
modifying the race detection engine.
We describe the RADAR framework and its implementation using a
pre-existing race detection engine. We show how RADAR was used to
generate a concurrent version of a null-pointer dereference analysis,
and we analyze the result of running the generated concurrent analysis
on several benchmarks.