SWORD: A Scalable Whole Program Race Detector for Java

We present the design and implementation of SWORD, a scalable and fully automated static data race detector for Java, implemented as a plugin in the Eclipse IDE. SWORD is the first whole program race detector that can scale to millions of lines of code in a few minutes while achieving good precision in practice. The cornerstone of SWORD is a new algorithm that judiciously combines points-to analysis and happens-before analysis efficiently, without losing precision. We have evaluated SWORD on an extensive collection of large-scale open source Java projects. Our results show that SWORD detects more races and reports fewer false positives than the state-of-art race detector, RacerD. Moreover, SWORD requires no human effort to annotate code regions as required by RacerD. SWORD also displays comprehensive bug traces and racing pair information on the GUI, which make debugging the races easier. A demo video is available at https://youtu.be/XQ0CBy7mMaY.