Lazy TSO Reachability

  • Ahmed Bouajjani
  • Georgel Calin
  • Egor Derevenetc
  • Roland Meyer
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9033)


We address the problem of checking state reachability for programs running under Total Store Order (TSO). The problem has been shown to be decidable but the cost is prohibitive, namely non-primitive recursive. We propose here to give up completeness. Our contribution is a new algorithm for TSO reachability: it uses the standard SC semantics and introduces the TSO semantics lazily and only where needed. At the heart of our algorithm is an iterative refinement of the program of interest. If the program’s goal state is SC-reachable, we are done. If the goal state is not SC-reachable, this may be due to the fact that SC underapproximates TSO. We employ a second algorithm that determines TSO computations which are infeasible under SC, and hence likely to lead to new states. We enrich the program to emulate, under SC, these TSO computations. Altogether, this yields an iterative under-approximation that we prove sound and complete for bug hunting, i.e., a semi-decision procedure halting for positive cases of reachability.We have implemented the procedure as an extension to the tool Trencher [1] and compared it to the Memorax [2] and CBMC [14] model checkers.


Model Checker Goal State Parallel Program Input Program Reachability Problem 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


  1. 1.
  2. 2.
    Abdulla, P.A., Atig, M.F., Chen, Y.-F., Leonardsson, C., Rezine, A.: Counter-Example Guided Fence Insertion under TSO. In: Flanagan, C., König, B. (eds.) TACAS 2012. LNCS, vol. 7214, pp. 204–219. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  3. 3.
    Alglave, J.: A Shared Memory Poetics. PhD thesis, University Paris 7 (2010)Google Scholar
  4. 4.
    Alglave, J., Kroening, D., Nimal, V., Poetzl, D.: Don’t Sit on the Fence. In: Biere, A., Bloem, R. (eds.) CAV 2014. LNCS, vol. 8559, pp. 508–524. Springer, Heidelberg (2014)CrossRefGoogle Scholar
  5. 5.
    Alglave, J., Kroening, D., Nimal, V., Tautschnig, M.: Software Verification for Weak Memory via Program Transformation. In: Felleisen, M., Gardner, P. (eds.) ESOP 2013. LNCS, vol. 7792, pp. 512–532. Springer, Heidelberg (2013)CrossRefGoogle Scholar
  6. 6.
    Alglave, J., Kroening, D., Tautschnig, M.: Partial Orders for Efficient BMC of Concurrent Software. CoRR, abs/1301.1629 (2013)Google Scholar
  7. 7.
    Alglave, J., Maranget, L.: Stability in Weak Memory Models. In: Gopalakrishnan, G., Qadeer, S. (eds.) CAV 2011. LNCS, vol. 6806, pp. 50–66. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  8. 8.
    Atig, M.F., Bouajjani, A., Burckhardt, S., Musuvathi, M.: On the Verification Problem for Weak Memory Models. In: POPL, pp. 7–18. ACM (2010)Google Scholar
  9. 9.
    Atig, M.F., Bouajjani, A., Parlato, G.: Getting Rid of Store-Buffers in TSO Analysis. In: Gopalakrishnan, G., Qadeer, S. (eds.) CAV 2011. LNCS, vol. 6806, pp. 99–115. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  10. 10.
    Bouajjani, A., Derevenetc, E., Meyer, R.: Checking and Enforcing Robustness against TSO. In: Felleisen, M., Gardner, P. (eds.) ESOP 2013. LNCS, vol. 7792, pp. 533–553. Springer, Heidelberg (2013)CrossRefGoogle Scholar
  11. 11.
    Bouajjani, A., Meyer, R., Möhlmann, E.: Deciding Robustness against Total Store Ordering. In: Aceto, L., Henzinger, M., Sgall, J. (eds.) ICALP 2011, Part II. LNCS, vol. 6756, pp. 428–440. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  12. 12.
    Burckhardt, S., Musuvathi, M.: Effective Program Verification for Relaxed Memory Models. In: Gupta, A., Malik, S. (eds.) CAV 2008. LNCS, vol. 5123, pp. 107–120. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  13. 13.
    Burnim, J., Sen, K., Stergiou, C.: Sound and Complete Monitoring of Sequential Consistency for Relaxed Memory Models. In: Abdulla, P.A., Leino, K.R.M. (eds.) TACAS 2011. LNCS, vol. 6605, pp. 11–25. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  14. 14.
    Clarke, E., Kroning, D., Lerda, F.: A Tool for Checking ANSI-C Programs. In: Jensen, K., Podelski, A. (eds.) TACAS 2004. LNCS, vol. 2988, pp. 168–176. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  15. 15.
    Holzmann, G.J.: The Model Checker SPIN. IEEE Tr. Sof. Eng. 23, 279–295 (1997)CrossRefGoogle Scholar
  16. 16.
    Kozen, D.: Lower Bounds for Natural Proof Systems. In: FOCS, pp. 254–266. IEEE Computer Society Press (1977)Google Scholar
  17. 17.
    Kuperstein, M., Vechev, M., Yahav, E.: Partial-Coherence Abstractions for Relaxed Memory Models. In: PLDI, pp. 187–198. ACM (2011)Google Scholar
  18. 18.
    Kuperstein, M., Vechev, M.T., Yahav, E.: Automatic Inference of Memory Fences. ACM SIGACT News 43(2), 108–123 (2012)CrossRefGoogle Scholar
  19. 19.
    Lamport, L.: How to Make a Multiprocessor Computer that Correctly Executes Multiprocess Programs. IEEE Tr. on Com. 28(9), 690–691 (1979)CrossRefzbMATHGoogle Scholar
  20. 20.
    Lamport, L.: A Fast Mutual Exclusion Algorithm. ACM Tr. Com. Sys. 5(1) (1987)Google Scholar
  21. 21.
    Linden, A., Wolper, P.: An Automata-Based Symbolic Approach for Verifying Programs on Relaxed Memory Models. In: van de Pol, J., Weber, M. (eds.) Model Checking Software. LNCS, vol. 6349, pp. 212–226. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  22. 22.
    Linden, A., Wolper, P.: A Verification-based Approach to Memory Fence Insertion in Relaxed Memory Systems. In: Groce, A., Musuvathi, M. (eds.) SPIN Workshops 2011. LNCS, vol. 6823, pp. 144–160. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  23. 23.
    Owens, S., Sarkar, S., Sewell, P.: A Better x86 Memory Model: x86-TSO (extended version). Technical Report CL-TR-745, University of Cambridge (2009)Google Scholar
  24. 24.
    Shasha, D., Snir, M.: Efficient and Correct Execution of Parallel Programs that Share Memory. ACM Tr. on Prog. Lang. and Sys. 10(2), 282–312 (1988)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2015

Authors and Affiliations

  • Ahmed Bouajjani
    • 1
  • Georgel Calin
    • 2
  • Egor Derevenetc
    • 2
    • 3
  • Roland Meyer
    • 2
  1. 1.LIAFAUniversity Paris 7ParisFrance
  2. 2.University of KaiserslauternKaiserslauternGermany
  3. 3.Fraunhofer ITWMKaiserslauternGermany

Personalised recommendations