May-happen-in-parallel analysis with static vector clocks

May-Happen-in-Parallel (MHP) analysis computes whether two statements in a multi-threaded program may execute concurrently or not. It works as a basis for many analyses and optimization techniques of concurrent programs. This paper proposes a novel approach for MHP analysis, by statically computing vector clocks. Static vector clocks extend the classic vector clocks algorithm to handle the complex control flow structures in static analysis, and we have developed an efficient context-sensitive algorithm to compute them. To the best of our knowledge, this is the first attempt to compute vector clocks statically. Using static vector clocks, we can drastically improve the efficiency of existing MHP analyses, without loss of precision: the performance speedup can be up to 1828X, with a much smaller memory footprint (reduced by up to 150X). We have implemented our analysis in a static data race detector, and experimental results show that our MHP analysis can help remove up to 88% of spurious data race pairs.

[1]  Jingling Xue,et al.  Acculock: Accurate and efficient detection of data races , 2011, International Symposium on Code Generation and Optimization (CGO 2011).

[2]  Dan Grossman,et al.  IFRit: interference-free regions for dynamic data-race detection , 2012, OOPSLA '12.

[3]  Grigore Rosu,et al.  Maximal sound predictive race detection with control flow abstraction , 2014, PLDI.

[4]  Jeff Huang,et al.  Precise and maximal race detection from incomplete traces , 2016, OOPSLA.

[5]  George S. Avrunin,et al.  An efficient algorithm for computing MHP information for concurrent Java programs , 1999, ESEC/FSE-7.

[6]  Vivek Sarkar,et al.  May-happen-in-parallel analysis of X10 programs , 2007, PPoPP.

[7]  Benjamin P. Wood,et al.  Lightweight data race detection for production runs , 2017, CC.

[8]  Sorin Lerner,et al.  RELAY: static race detection on millions of lines of code , 2007, ESEC-FSE '07.

[9]  Lian Li,et al.  Precise and scalable context-sensitive pointer analysis via value flow graph , 2013, ISMM '13.

[10]  Jingling Xue,et al.  Region-Based May-Happen-in-Parallel Analysis for C Programs , 2015, 2015 44th International Conference on Parallel Processing.

[11]  Jingling Xue,et al.  Efficient and precise points-to analysis: modeling the heap by merging equivalent automata , 2017, PLDI.

[12]  V. Krishna Nandivada,et al.  Improved MHP Analysis , 2016, CC.

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

[14]  Barbara G. Ryder,et al.  Non-concurrency analysis , 1993, PPOPP '93.

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

[16]  Rajkishore Barik,et al.  Efficient Computation of May-Happen-in-Parallel Information for Concurrent Java Programs , 2005, LCPC.

[17]  Stephen N. Freund,et al.  Types for atomicity: Static checking and inference for Java , 2008, TOPL.

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

[19]  Michael Hicks,et al.  LOCKSMITH: Practical static race detection for C , 2011, TOPL.

[20]  R. K. Shyamasundar,et al.  A New Method of MHP Analysis for Languages with Dynamic Barriers , 2012, 2012 IEEE 26th International Parallel and Distributed Processing Symposium Workshops & PhD Forum.

[21]  Jong-Deok Choi,et al.  Hybrid dynamic data race detection , 2003, PPoPP '03.

[22]  Elvira Albert,et al.  May-Happen-in-Parallel Analysis for Asynchronous Programs with Inter-Procedural Synchronization , 2015, SAS.

[23]  Jingling Xue,et al.  On-demand strong update analysis via value-flow refinement , 2016, SIGSOFT FSE.

[24]  Jens Krinke,et al.  Context-sensitive slicing of concurrent programs , 2003, ESEC/FSE-11.

[25]  Mary Lou Soffa,et al.  Concurrency analysis in the presence of procedures using a data-flow framework , 1991, TAV4.

[26]  Thomas W. Reps,et al.  Program analysis via graph reachability , 1997, Inf. Softw. Technol..

[27]  Wei Wang,et al.  POSIX threads programming , 2005 .

[28]  Jens Palsberg,et al.  Sherlock: scalable deadlock detection for concurrent programs , 2014, SIGSOFT FSE.

[29]  Jingling Xue,et al.  Sparse flow-sensitive pointer analysis for multithreaded programs , 2016, 2016 IEEE/ACM International Symposium on Code Generation and Optimization (CGO).

[30]  Lian Li,et al.  Boosting the performance of flow-sensitive points-to analysis using value flow , 2011, ESEC/FSE '11.

[31]  Peter Grogono,et al.  Static analysis of concurrent programs by adapted vector clock , 2013, C3S2E '13.

[32]  Baowen Xu,et al.  Interstatement must aliases for data dependence analysis of heap locations , 2007, PASTE '07.

[33]  Alexander Aiken,et al.  Effective static race detection for Java , 2006, PLDI '06.

[34]  Tao B. Schardl,et al.  Efficiently Detecting Races in Cilk Programs That Use Reducer Hyperobjects , 2015, SPAA.