Effective race detection for event-driven programs

Like shared-memory multi-threaded programs, event-driven programs such as client-side web applications are susceptible to data races that are hard to reproduce and debug. Race detection for such programs is hampered by their pervasive use of ad hoc synchronization, which can lead to a prohibitive number of false positives. Race detection also faces a scalability challenge, as a large number of short-running event handlers can quickly overwhelm standard vector-clock-based techniques. This paper presents several novel contributions that address both of these challenges. First, we introduce race coverage, a systematic method for exposing ad hoc synchronization and other (potentially harmful) races to the user, significantly reducing false positives. Second, we present an efficient connectivity algorithm for computing race coverage. The algorithm is based on chain decomposition and leverages the structure of event-driven programs to dramatically decrease the overhead of vector clocks. We implemented our techniques in a tool called EventRacer and evaluated it on a number of public web sites. The results indicate substantial performance and precision improvements of our approach over the state-of-the-art. Using EventRacer, we found many harmful races, most of which are beyond the reach of current techniques.

[1]  Leslie Lamport,et al.  Time, clocks, and the ordering of events in a distributed system , 1978, CACM.

[2]  Barton P. Miller,et al.  Detecting Data Races in Parallel Program Executions , 1989 .

[3]  H. V. Jagadish,et al.  A compression technique to materialize transitive closure , 1990, TODS.

[4]  Barton P. Miller,et al.  Improving the accuracy of data race detection , 1991, PPOPP '91.

[5]  Koen De Bosschere,et al.  Accordion Clocks: Logical Clocks for Data Race Detection , 2001, Euro-Par.

[6]  Friedemann Mattern,et al.  Virtual Time and Global States of Distributed Systems , 2002 .

[7]  Assaf Schuster,et al.  Efficient on-the-fly data race detection in multithreaded C++ programs , 2003, PPoPP '03.

[8]  Anurag Agarwal,et al.  Efficient dependency tracking for relevant events in shared-memory systems , 2005, PODC '05.

[9]  Satish Narayanasamy,et al.  Automatically classifying benign and harmful data races using replay analysis , 2007, PLDI '07.

[10]  Koushik Sen,et al.  Race directed random testing of concurrent programs , 2008, PLDI '08.

[11]  R. Bodík,et al.  Concurrency Concerns in Rich Internet Applications , 2009 .

[12]  Stephen N. Freund,et al.  FastTrack: efficient and precise dynamic race detection , 2009, PLDI '09.

[13]  Wenguang Chen,et al.  Do I use the wrong definition?: DeFuse: definition-use invariants for detecting concurrency and sequential bugs , 2010, OOPSLA.

[14]  Jan Vitek,et al.  An analysis of the dynamic behavior of JavaScript programs , 2010, PLDI '10.

[15]  Xiangyu Zhang,et al.  Statically locating web application bugs caused by asynchronous calls , 2011, WWW.

[16]  Frank Tip,et al.  A framework for automated testing of javascript web applications , 2011, 2011 33rd International Conference on Software Engineering (ICSE).

[17]  Manu Sridharan,et al.  Race detection for web applications , 2012, PLDI.

[18]  George Candea,et al.  Data races vs. data race bugs: telling the difference with portend , 2012, ASPLOS XVII.