ABSTRACT
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.
- Shivali Agarwal, Rajkishore Barik, Vivek Sarkar, and Rudrapatna K. Shyamasundar. 2007. May-happen-in-parallel Analysis of X10 Programs. In Proceedings of the 12th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP ’07). ACM, New York, NY, USA, 183–193. Google ScholarDigital Library
- Rajkishore Barik. 2005. Efficient Computation of May-Happen-inParallel Information for Concurrent Java Programs. In Languages and Compilers for Parallel Computing (LCPC 2005). Springer, Berlin, Heidelberg, 152–169. Google ScholarDigital Library
- Blaise Barney. 2017. POSIX Threads Programming. (2017). https: //computing.llnl.gov/tutorials/pthreads/Google Scholar
- Swarnendu Biswas, Man Cao, Minjia Zhang, Michael D. Bond, and Benjamin P. Wood. 2017. Lightweight Data Race Detection for Production Runs. In Proceedings of the 26th International Conference on Compiler Construction (CC 2017). ACM, New York, NY, USA, 11–21. Google ScholarDigital Library
- Evelyn Duesterwald and Mary Lou Soffa. 1991. Concurrency Analysis in the Presence of Procedures Using a Data-flow Framework. In Proceedings of the Symposium on Testing, Analysis, and Verification (TAV4). ACM, New York, NY, USA, 36–48. Google ScholarDigital Library
- Laura Effinger-Dean, Brandon Lucia, Luis Ceze, Dan Grossman, and Hans-J. Boehm. 2012. IFRit: Interference-free Regions for Dynamic Data-race Detection. In Proceedings of the ACM International Conference on Object Oriented Programming Systems Languages and Applications (OOPSLA ’12). ACM, New York, NY, USA, 467–484. Google ScholarDigital Library
- Pablo Gordillo. Elvira Albert, Samir Genaim. 2015. May-Happen-inParallel Analysis for Asynchronous Programs with Inter-Procedural Synchronization. In Static Analysis Symposium (SAS 2015). Springer, Berlin, Heidelberg, 72–89.Google Scholar
- Mahdi Eslamimehr and Jens Palsberg. 2014. Sherlock: Scalable Deadlock Detection for Concurrent Programs. In Proceedings of the 22Nd ACM SIGSOFT International Symposium on Foundations of Software Engineering (FSE 2014). ACM, New York, NY, USA, 353–365. Google ScholarDigital Library
- Cormac Flanagan and Stephen N. Freund. 2010. FastTrack: Efficient and Precise Dynamic Race Detection. Commun. ACM 53, 11 (Nov. 2010), 93–101. Google ScholarDigital Library
- Cormac Flanagan, Stephen N. Freund, Marina Lifshin, and Shaz Qadeer. 2008. Types for Atomicity: Static Checking and Inference for Java. ACM Trans. Program. Lang. Syst. 30, 4, Article 20 (Aug. 2008), 53 pages. Google ScholarDigital Library
- Jeff Huang, Patrick O’Neil Meredith, and Grigore Rosu. 2014. Maximal Sound Predictive Race Detection with Control Flow Abstraction. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’14). ACM, New York, NY, USA, 337–348. Google ScholarDigital Library
- Jeff Huang and Arun K. Rajagopalan. 2016. Precise and Maximal Race Detection from Incomplete Traces. In Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2016). ACM, New York, NY, USA, 462–476. Google ScholarDigital Library
- Jens Krinke. 2003. Context-sensitive Slicing of Concurrent Programs. In Proceedings of the 9th European Software Engineering Conference Held Jointly with 11th ACM SIGSOFT International Symposium on Foundations of Software Engineering (ESEC/FSE-11). ACM, New York, NY, USA, 178–187. Google ScholarDigital Library
- Leslie Lamport. 1978. Time, Clocks, and the Ordering of Events in a Distributed System. Commun. ACM 21, 7 (July 1978), 558–565. Google ScholarDigital Library
- I-Ting Angelina Lee and Tao B. Schardl. 2015. Efficiently Detecting Races in Cilk Programs That Use Reducer Hyperobjects. In Proceedings of the 27th ACM Symposium on Parallelism in Algorithms and Architectures (SPAA ’15). ACM, New York, NY, USA, 111–122. Google ScholarDigital Library
- Lian Li, Cristina Cifuentes, and Nathan Keynes. 2011. Boosting the Performance of Flow-sensitive Points-to Analysis Using Value Flow. In Proceedings of the 19th ACM SIGSOFT Symposium and the 13th European Conference on Foundations of Software Engineering (ESEC/FSE ’11). ACM, New York, NY, USA, 343–353. Google ScholarDigital Library
- Lian Li, Cristina Cifuentes, and Nathan Keynes. 2013. Precise and Scalable Context-sensitive Pointer Analysis via Value Flow Graph. In Proceedings of the 2013 International Symposium on Memory Management (ISMM ’13). ACM, New York, NY, USA, 85–96. Google ScholarDigital Library
- Stephen P. Masticola and Barbara G. Ryder. 1993. Non-concurrency Analysis. In Proceedings of the Fourth ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPOPP ’93). ACM, New York, NY, USA, 129–138. Google ScholarDigital Library
- Friedemann Mattern. 1988. Virtual Time and Global States of Distributed Systems. In PARALLEL AND DISTRIBUTED ALGORITHMS. North-Holland, 215–226.Google Scholar
- Mayur Naik, Alex Aiken, and John Whaley. 2006. Effective Static Race Detection for Java. In Proceedings of the 27th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’06). ACM, New York, NY, USA, 308–319. Google ScholarDigital Library
- Gleb Naumovich, George S. Avrunin, and Lori A. Clarke. 1999. An Efficient Algorithm for Computing MHP Information for Concurrent Java Programs. In Proceedings of the 7th European Software Engineering Conference Held Jointly with the 7th ACM SIGSOFT International Symposium on Foundations of Software Engineering (ESEC/FSE-7). Springer-Verlag, London, UK, UK, 338–354. http://dl.acm.org/citation.cfm?id=318773. 319252 Google ScholarDigital Library
- Robert O’Callahan and Jong-Deok Choi. 2003. Hybrid Dynamic Data Race Detection. In Proceedings of the Ninth ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP ’03). ACM, New York, NY, USA, 167–178. Google ScholarDigital Library
- Ding ye Peng Di, Yulei Sui and Jingling Xue. 2015. Region-Based MayHappen-in-Parallel Analysis for C Programs. In 44th International Conference on Parallel Processing (ICPP 2015). IEEE, 889–898. Google ScholarDigital Library
- Polyvios Pratikakis, Jeffrey S. Foster, and Michael Hicks. 2011. LOCK-SMITH: Practical Static Race Detection for C. ACM Trans. Program. Lang. Syst. 33, 1, Article 3 (Jan. 2011), 55 pages. Google ScholarDigital Library
- Ju Qian, Baowen Xu, and Hongbo Min. 2007. Interstatement Must Aliases for Data Dependence Analysis of Heap Locations. In Proceedings of the 7th ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering (PASTE ’07). ACM, New York, NY, USA, 17–24. Google ScholarDigital Library
- Thomas Reps. 1998. Program analysis via graph reachability. Information and Software Technology (1998), 701–726.Google Scholar
- Aravind Sankar, Soham Chakraborty, and V. Krishna Nandivada. 2016. Improved MHP Analysis. In Proceedings of the 25th International Conference on Compiler Construction (CC 2016). ACM, New York, NY, USA, 207–217. Google ScholarDigital Library
- Sanjeev K. Aggarwal. Saurabh Joshi, R.K.Shyamasundar. 2012. A New Method of MHP Analysis for Languages with Dynamic Barriers. In IEEE 26th International Parallel and Distributed Processing Symposium Workshops & PHD Forum (IPDPSW). IEEE, 519–528. Google ScholarDigital Library
- Yulei Sui, Peng Di, and Jingling Xue. 2016. Sparse Flow-sensitive Pointer Analysis for Multithreaded Programs. In Proceedings of the 2016 International Symposium on Code Generation and Optimization (CGO ’16). ACM, New York, NY, USA, 160–170. Google ScholarDigital Library
- Yulei Sui and Jingling Xue. 2016. On-demand Strong Update Analysis via Value-flow Refinement. In Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering (FSE 2016). ACM, New York, NY, USA, 460–473. Google ScholarDigital Library
- Tian Tan, Yue Li, and Jingling Xue. 2017. Efficient and Precise Points-to Analysis: Modeling the Heap by Merging Equivalent Automata. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2017). ACM, New York, NY, USA, 278–291. Google ScholarDigital Library
- Jan Wen Voung, Ranjit Jhala, and Sorin Lerner. 2007. RELAY: Static Race Detection on Millions of Lines of Code. In Proceedings of the the 6th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on The Foundations of Software Engineering (ESEC-FSE ’07). ACM, New York, NY, USA, 205–214. Google ScholarDigital Library
- Xinwei Xie and Jingling Xue. 2011. Acculock: Accurate and Efficient Detection of Data Races. In Proceedings of the 9th Annual IEEE/ACM International Symposium on Code Generation and Optimization (CGO ’11). IEEE Computer Society, Washington, DC, USA, 201–212. http: //dl.acm.org/citation.cfm?id=2190025.2190068 Google ScholarDigital Library
- Maryam Zakeryfar and Peter Grogono. 2013. Static Analysis of Concurrent Programs by Adapted Vector Clock. In Proceedings of the International C* Conference on Computer Science and Software Engineering (C3S2E ’13). ACM, New York, NY, USA, 58–66. Google ScholarDigital Library
Index Terms
- May-happen-in-parallel analysis with static vector clocks
Recommendations
May-Happen-in-Parallel Analysis for Actor-Based Concurrency
This article presents a may-happen-in-parallel (MHP) analysis for languages with actor-based concurrency. In this concurrency model, actors are the concurrency units such that, when a method is invoked on an actor a2 from a task executing on actor a1, ...
Introspective analysis: context-sensitivity, across the board
PLDI '14: Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and ImplementationContext-sensitivity is the primary approach for adding more precision to a points-to analysis, while hopefully also maintaining scalability. An oft-reported problem with context-sensitive analyses, however, is that they are bi-modal: either the analysis ...
Region-Based May-Happen-in-Parallel Analysis for C Programs
ICPP '15: Proceedings of the 2015 44th International Conference on Parallel Processing (ICPP)The C programming language continues to play an essential role in the development of system software. May-Happen-in-Parallel (MHP) analysis is the basis of many other analyses and optimisations for concurrent programs. Existing MHP analyses that work ...
Comments