skip to main content
research-article
Open Access
Artifacts Available
Artifacts Evaluated & Functional

Effective stateless model checking for C/C++ concurrency

Published:27 December 2017Publication History
Skip Abstract Section

Abstract

We present a stateless model checking algorithm for verifying concurrent programs running under RC11, a repaired version of the C/C++11 memory model without dependency cycles. Unlike most previous approaches, which enumerate thread interleavings up to some partial order reduction improvements, our approach works directly on execution graphs and (in the absence of RMW instructions and SC atomics) avoids redundant exploration by construction. We have implemented a model checker, called RCMC, based on this approach and applied it to a number of challenging concurrent programs. Our experiments confirm that RCMC is significantly faster, scales better than other model checking tools, and is also more resilient to small changes in the benchmarks.

Skip Supplemental Material Section

Supplemental Material

ccconcurrency.webm

webm

122.6 MB

References

  1. Parosh Abdulla, Stavros Aronis, Bengt Jonsson, and Konstantinos Sagonas. 2014. Optimal dynamic partial order reduction. In POPL 2014. ACM, New York, NY, USA, 373–384. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Parosh Aziz Abdulla, Stavros Aronis, Mohamed Faouzi Atig, Bengt Jonsson, Carl Leonardsson, and Konstantinos Sagonas. 2015. Stateless Model Checking for TSO and PSO. In TACAS 2015 (LNCS), Vol. 9035. Springer, Berlin, Heidelberg, 353–367. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Parosh Aziz Abdulla, Stavros Aronis, Bengt Jonsson, and Konstantinos Sagonas. 2017. Source Sets: A Foundation for Optimal Dynamic Partial Order Reduction. 64, 4, Article 25 (Sept. 2017), 49 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Parosh Aziz Abdulla, Mohamed Faouzi Atig, Bengt Jonsson, and Carl Leonardsson. 2016. Stateless Model Checking for POWER. In CAV 2016 (LNCS), Vol. 9780. Springer, Berlin, Heidelberg, 134–156. Google ScholarGoogle ScholarCross RefCross Ref
  5. Jade Alglave. 2013. Weakness is a virtue (position paper). In EC 2 . http://www0.cs.ucl.ac.uk/staff/j.alglave/papers/ec213.pdfGoogle ScholarGoogle Scholar
  6. Jade Alglave, Daniel Kroening, Vincent Nimal, and Michael Tautschnig. 2013b. Software Verification for Weak Memory via Program Transformation. In ESOP 2013. Springer-Verlag, Berlin, Heidelberg, 512–532. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Jade Alglave, Daniel Kroening, and Michael Tautschnig. 2013a. Partial Orders for Efficient Bounded Model Checking of Concurrent Software. In CAV 2013 (LNCS), Vol. 8044. Springer, Berlin, Heidelberg, 141–157. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Jade Alglave, Luc Maranget, and Michael Tautschnig. 2014. Herding Cats: Modelling, Simulation, Testing, and Data Mining for Weak Memory. ACM Trans. Program. Lang. Syst. 36, 2, Article 7 (July 2014), 74 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Mark Batty, Kayvan Memarian, Kyndylan Nienhuis, Jean Pichon-Pharabod, and Peter Sewell. 2015. The Problem of Programming Language Concurrency Semantics. In ESOP 2015 (LNCS), Vol. 9032. Springer, Berlin, Heidelberg, 283–307. Google ScholarGoogle ScholarCross RefCross Ref
  10. Mark Batty, Scott Owens, Susmit Sarkar, Peter Sewell, and Tjark Weber. 2011. Mathematizing C++ Concurrency. In POPL 2011. ACM, New York, NY, USA, 55–66. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Hans-J. Boehm and Brian Demsky. 2014. Outlawing Ghosts: Avoiding Out-of-thin-air Results. In MSPC 2014. ACM, New York, NY, USA, Article 7, 6 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Ahmed Bouajjani, Constantin Enea, Rachid Guerraoui, and Jad Hamza. 2017. On Verifying Causal Consistency. In POPL 2017. ACM, New York, NY, USA, 626–638. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Edmund M. Clarke, E. Allen Emerson, and A. Prasad Sistla. 1983. Automatic Verification of Finite-State Concurrent Systems Using Temporal Logics Specification: A Practical Approach. In POPL 1983. ACM Press, 117–126. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Edmund M. Clarke, Daniel Kroening, and Flavio Lerda. 2004. A Tool for Checking ANSI-C Programs. In TACAS 2004 (LNCS), Vol. 2988. Springer, Berlin, Heidelberg, 168–176. Google ScholarGoogle ScholarCross RefCross Ref
  15. Brian Demsky and Patrick Lam. 2015. 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 (OOPSLA 2015). ACM, New York, NY, USA, 20–36. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Cormac Flanagan and Patrice Godefroid. 2005. Dynamic partial-order reduction for model checking software. In POPL 2005. ACM, New York, NY, USA, 110–121. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Phillip B. Gibbons and Ephraim Korach. 1997. Testing Shared Memories. SIAM J. Comput. 26, 4 (Aug. 1997), 1208–1244. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Patrice Godefroid. 1997. Model Checking for Programming Languages using VeriSoft. In POPL 1997. ACM, New York, NY, USA, 174–186. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Patrice Godefroid. 2005. Software Model Checking: The VeriSoft Approach. Formal Methods in System Design 26, 2 (March 2005), 77–101. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Jeff Huang. 2015. Stateless model checking concurrent programs with maximal causality reduction. In PLDI 2015. ACM, New York, NY, USA, 165–174. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Shiyou Huang and Jeff Huang. 2016. Maximal Causality Reduction for TSO and PSO. In OOPSLA 2016. ACM, New York, NY, USA, 447–461. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Kari Kähkönen, Olli Saarikivi, and Keijo Heljanko. 2015. Unfolding Based Automated Testing of Multithreaded Programs. Autom. Softw. Eng. 22, 4 (Dec. 2015), 475–515. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Jan-Oliver Kaiser, Hoang-Hai Dang, Derek Dreyer, Ori Lahav, and Viktor Vafeiadis. 2017. Strong Logic for Weak Memory: Reasoning About Release-Acquire Consistency in Iris. In ECOOP 2017, Vol. 74. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany, 17:1–17:29. Google ScholarGoogle ScholarCross RefCross Ref
  24. Ori Lahav and Viktor Vafeiadis. 2015. Owicki-Gries Reasoning for Weak Memory Models. In ICALP 2015 (LNCS), Vol. 9135. Springer, 311–323. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Ori Lahav, Viktor Vafeiadis, Jeehoon Kang, Chung-Kil Hur, and Derek Dreyer. 2017. Repairing Sequential Consistency in C/C++11. In PLDI 2017. ACM, New York, NY, USA, 618–632. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Leslie Lamport. 1979. How to Make a Multiprocessor Computer That Correctly Executes Multiprocess Programs. IEEE Trans. Computers 28, 9 (Sept. 1979), 690–691. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Antoni Mazurkiewicz. 1987. Trace Theory. In Petri Nets: Applications and Relationships to Other Models of Concurrency (LNCS), Vol. 255. Springer, Berlin, Heidelberg, 279–324. Google ScholarGoogle ScholarCross RefCross Ref
  28. Kenneth L. McMillan. 1995. A Technique of a State Space Search Based on Unfolding. Formal Methods in System Design 6, 1 (Jan. 1995), 45–65. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Mandanlal Musuvathi, Shaz Qadeer, Thomas Ball, Gerald Basler, Piramanayagam Arumuga Nainar, and Iulian Neamtiu. 2008. Finding and Reproducing Heisenbugs in Concurrent Programs. In Proceedings of the 8th USENIX Symposium on Operating Systems Design and Implementation. USENIX Association, Berkeley, CA, USA, 267–280.Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Brian Norris and Brian Demsky. 2016. A Practical Approach for Model Checking C/C++11 Code. ACM Trans. Program. Lang. Syst. 38, 3, Article 10 (May 2016), 51 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Jean-Pierre Queille and Joseph Sifakis. 1982. Specification and Verification of Concurrent Systems in CESAR. In Intl. Symp. on Progr. (LNCS), Vol. 137. Springer-Verlag, Berlin, Heidelberg, 337–351. Google ScholarGoogle ScholarCross RefCross Ref
  32. César Rodríguez, Marcelo Sousa, Subodh Sharma, and Daniel Kroening. 2015. Unfolding-based Partial Order Reduction. In 26th International Conference on Concurrency Theory, CONCUR 2015 (LIPIcs), Vol. 42. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, 456–469. Google ScholarGoogle ScholarCross RefCross Ref
  33. Dennis Shasha and Marc Snir. 1988. Efficient and Correct Execution of Parallel Programs That Share Memory. ACM Trans. Program. Lang. Syst. 10, 2 (April 1988), 282–312. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Aaron Turon, Viktor Vafeiadis, and Derek Dreyer. 2014. GPS: Navigating Weak Memory with Ghosts, Protocols, and Separation. In OOPSLA 2014. ACM, 691–707. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Viktor Vafeiadis, Thibaut Balabonski, Soham Chakraborty, Robin Morisset, and Francesco Zappa Nardelli. 2015. Common Compiler Optimisations Are Invalid in the C11 Memory Model and What We Can Do About It. In POPL 2015. ACM, New York, NY, USA, 209–220. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Viktor Vafeiadis and Chinmay Narayan. 2013. Relaxed Separation Logic: A program logic for C11 concurrency. In OOPSLA 2013. ACM, New York, NY, USA, 867–884. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Naling Zhang, Markus Kusano, and Chao Wang. 2015. Dynamic partial order reduction for relaxed memory models. In PLDI 2015. ACM, New York, NY, USA, 250–259. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Effective stateless model checking for C/C++ concurrency

          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

          Full Access

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader