skip to main content
10.1145/3168813acmconferencesArticle/Chapter ViewAbstractPublication PagescgoConference Proceedingsconference-collections

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

Authors Info & Claims
Published:24 February 2018Publication History

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.

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. Blaise Barney. 2017. POSIX Threads Programming. (2017). https: //computing.llnl.gov/tutorials/pthreads/Google ScholarGoogle Scholar
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle Scholar
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. Cormac Flanagan and Stephen N. Freund. 2010. FastTrack: Efficient and Precise Dynamic Race Detection. Commun. ACM 53, 11 (Nov. 2010), 93–101. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  14. Leslie Lamport. 1978. Time, Clocks, and the Ordering of Events in a Distributed System. Commun. ACM 21, 7 (July 1978), 558–565. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  16. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  17. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. Friedemann Mattern. 1988. Virtual Time and Global States of Distributed Systems. In PARALLEL AND DISTRIBUTED ALGORITHMS. North-Holland, 215–226.Google ScholarGoogle Scholar
  20. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  21. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  22. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  23. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  24. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  25. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  26. Thomas Reps. 1998. Program analysis via graph reachability. Information and Software Technology (1998), 701–726.Google ScholarGoogle Scholar
  27. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  28. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  29. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  30. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  31. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  32. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  33. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  34. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

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

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        CGO 2018: Proceedings of the 2018 International Symposium on Code Generation and Optimization
        February 2018
        377 pages
        ISBN:9781450356176
        DOI:10.1145/3179541

        Copyright © 2018 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 24 February 2018

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Acceptance Rates

        Overall Acceptance Rate312of1,061submissions,29%

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader