skip to main content
10.1145/2983990.2984025acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

Maximal causality reduction for TSO and PSO

Published:19 October 2016Publication History

ABSTRACT

Verifying concurrent programs is challenging due to the exponentially large thread interleaving space. The problem is exacerbated by relaxed memory models such as Total Store Order (TSO) and Partial Store Order (PSO) which further explode the interleaving space by reordering instructions. A recent advance, Maximal Causality Reduction (MCR), has shown great promise to improve verification effectiveness by maximally reducing redundant explorations. However, the original MCR only works for the Sequential Consistency (SC) memory model, but not for TSO and PSO. In this paper, we develop novel extensions to MCR by solving two key problems under TSO and PSO: 1) generating interleavings that can reach new states by encoding the operational semantics of TSO and PSO with first-order logical constraints and solving them with SMT solvers, and 2) enforcing TSO and PSO interleavings by developing novel replay algorithms that allow executions out of the program order. We show that our approach successfully enables MCR to effectively explore TSO and PSO interleavings. We have compared our approach with a recent Dynamic Partial Order Reduction (DPOR) algorithm for TSO and PSO and a SAT-based stateless model checking approach. Our results show that our approach is much more effective than the other approaches for both state-space exploration and bug finding – on average it explores 5-10X fewer executions and finds many bugs that the other tools cannot find.

References

  1. ASM bytecode analysis framework. http://asm.ow2.org/.Google ScholarGoogle Scholar
  2. A real-world bug caused by relaxed consistency. http: //stackoverflow.com/questions/16159203/.Google ScholarGoogle Scholar
  3. P. Abdulla, S. Aronis, B. Jonsson, and K. Sagonas. Optimal dynamic partial order reduction. In Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. P. A. Abdulla, S. Aronis, M. F. Atig, B. Jonsson, C. Leonardsson, and K. F. Sagonas. Stateless model checking for TSO and PSO. CoRR, 2015.Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. S. V. Adve and K. Gharachorloo. Shared memory consistency models: A tutorial. computer, 29(12):66–76, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. M. F. Atig, A. Bouajjani, S. Burckhardt, and M. Musuvathi. On the verification problem for weak memory models. In Proceedings of the 37th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. M. F. Atig, A. Bouajjani, S. Burckhardt, and M. Musuvathi. What’s decidable about weak memory models? In Programming Languages and Systems, pages 26–46. Springer, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. S. Burckhardt, R. Alur, and M. M. K. Martin. Checkfence: Checking consistency of concurrent data types on relaxed memory models. In Proceedings of the 28th ACM SIGPLAN Conference on Programming Language Design and Implementation, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. S. Burckhardt, P. Kothari, M. Musuvathi, and S. Nagarakatte. A randomized scheduler with probabilistic guarantees of finding bugs. In Proceedings of the Fifteenth Edition of ASPLOS on Architectural Support for Programming Languages and Operating Systems, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. S. Burckhardt and M. Musuvathi. Effective program verification for relaxed memory models. In Computer Aided Verification, pages 107–120. Springer, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. J. Burnim, K. Sen, and C. Stergiou. Testing concurrent programs on relaxed memory models. In Proceedings of the 2011 International Symposium on Software Testing and Analysis, pages 122–132. ACM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. E. M. Clarke, O. Grumberg, and D. Peled. Model checking. MIT press, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. K. E. Coons, M. Musuvathi, and K. S. Mckinley. Bounded partial-order reduction. In In Proceedings of the 2013 Annual ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 833–848, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. L. De Moura and N. Bjørner. Z3: An efficient SMT solver. In Tools and Algorithms for the Construction and Analysis of Systems, pages 337–340. Springer, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. B. Demsky and P. Lam. SATCheck: SAT-directed stateless model checking for SC and TSO. In Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications. ACM, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. C. Flanagan and P. Godefroid. Dynamic partial-order reduction for model checking software. In Proceedings of the 32Nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. P. Godefroid. Model checking for programming languages using verisoft. In Proceedings of the 24th ACM SIGPLANSIGACT symposium on Principles of programming languages. ACM, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. P. Godefroid. Software model checking: The VeriSoft approach. Formal Methods in System Design, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. P. Godefroid, J. van Leeuwen, J. Hartmanis, G. Goos, and P. Wolper. Partial-order methods for the verification of concurrent systems: an approach to the state-explosion problem, volume 1032. Springer Heidelberg, 1996. Google ScholarGoogle ScholarCross RefCross Ref
  20. G. J. Holzmann. The SPIN model checker: Primer and reference manual, volume 1003. Addison-Wesley Reading, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. J. Huang. Stateless model checking concurrent programs with maximal causality reduction. In Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. J. Huang, P. O. Meredith, and G. Rosu. Maximal sound predictive race detection with control flow abstraction. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. S. International. The SPARC Architecture Manual: Version 8. 1992.Google ScholarGoogle Scholar
  24. L. Lamport. How to make a multiprocessor computer that correctly executes multiprocess programs. Computers, IEEE Transactions on, 100(9):690–691, 1979. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. A. Linden and P. Wolper. An automata-based symbolic approach for verifying programs on relaxed memory models. In Proceedings of the 17th International SPIN Conference on Model Checking Software, SPIN’10, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. A. Linden and P. Wolper. A verification-based approach to memory fence insertion in relaxed memory systems. In Proceedings of the 18th International SPIN Conference on Model Checking Software, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. S. Lu, W. Jiang, and Y. Zhou. A study of interleaving coverage criteria. In Joint European Software Engineering Conference and ACM SIGSOFT Symposium on Foundations of Software Engineering, pages 533–536, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. J. Manson, W. Pugh, and S. V. Adve. The java memory model. In Proceedings of the 32Nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. A. Mazurkiewicz. Trace theory. In Petri nets: applications and relationships to other models of concurrency, pages 278–324. Springer, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. T. Mitra, A. Roychoudhury, and Q. Shen. Impact of Java Memory Model on Out-of-Order Multiprocessors. In Proceedings of the 13th International Conference on Parallel Architectures and Compilation Techniques, PACT, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. M. Musuvathi and S. Qadeer. Partial-order reduction for context-bounded state exploration. Technical report, MSRTR-2007-12, Microsoft Research, 2007.Google ScholarGoogle Scholar
  32. M. Musuvathi, S. Qadeer, T. Ball, G. Basler, P. A. Nainar, and I. Neamtiu. Finding and reproducing heisenbugs in concurrent programs. In OSDI, volume 8, pages 267–280, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. S. Owens, S. Sarkar, P. Sewell, and A. Better. x86 Memory Model: x86-TSO. In Proceedings of the 22nd International Conference on Theorem Proving in Higher Order Logics, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. A. Roychoudhury. Formal reasoning about hardware and software memory models. In Proceedings of the 4th International Conference on Formal Engineering Methods: Formal Methods and Software Engineering, ICFEM, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. T. F. ¸Serbănu¸tă, F. Chen, and G. Ro¸su. Maximal causal models for sequentially consistent systems. In Runtime Verification, pages 136–150. Springer, 2013.Google ScholarGoogle Scholar
  36. E. Torlak, M. Vaziri, and J. Dolby. MemSAT: Checking Axiomatic Specifications of Memory Models. In Proceedings of the 31st ACM SIGPLAN Conference on Programming Language Design and Implementation, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Y. Yang, X. Chen, G. Gopalakrishnan, and R. M. Kirby. Efficient stateful dynamic partial order reduction. In Proceedings of the 15th International Workshop on Model Checking Software, SPIN, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. N. Zhang, M. Kusano, and C. Wang. Dynamic partial order reduction for relaxed memory models. In Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Maximal causality reduction for TSO and PSO

            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
              OOPSLA 2016: Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications
              October 2016
              915 pages
              ISBN:9781450344449
              DOI:10.1145/2983990

              Copyright © 2016 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: 19 October 2016

              Permissions

              Request permissions about this article.

              Request Permissions

              Check for updates

              Qualifiers

              • research-article

              Acceptance Rates

              Overall Acceptance Rate268of1,244submissions,22%

              Upcoming Conference

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader