Skip to main content

SMT-Based Verification of Persistency Invariants of Px86 Programs

  • Conference paper
  • First Online:
Verified Software. Theories, Tools and Experiments. (VSTTE 2022)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 13800))

  • 259 Accesses

Abstract

While non-volatile memory (NVM) promises to be both performant and durable, the semantics provided by the hardware architectures are rather subtle and significantly complicate reasoning about the possible observed state after a crash.

Starting from recent persistency extension of the x86 model, we present the first automated approach for proving invariants about the persistent state of bounded NVM programs. Our approach works by encoding the program’s semantics along with its intended invariants into a compact logical formula and querying an SMT solver for its satisfiability. We propose two alternative encodings, which differ in the way the notion of a crash is encoded. For a collection of small to medium-size benchmarks, our implementation is able to detect or prove absence of persistency bugs in time ranging from a couple of seconds to some minutes.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Khyzha et al. [14] actually present two versions of \(\textrm{DPTSO}_\textrm{syn}\). Throughout this paper we use the second version, which uses the coherence order to define consistency.

References

  1. Alglave, J., Kroening, D., Tautschnig, M.: Partial orders for efficient bounded model checking of concurrent software. In: Sharygina, N., Veith, H. (eds.) CAV 2013. LNCS, vol. 8044, pp. 141–157. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-39799-8_9

    Chapter  MATH  Google Scholar 

  2. Bender, M.A., Fineman, J.T., Gilbert, S., Tarjan, R.E.: A new approach to incremental cycle detection and related problems. ACM Trans. Algorithms 12(2) (2015). https://doi.org/10.1145/2756553. ISSN 1549-6325

  3. Cho, K., Lee, S.-H., Raad, A., Kang, J.: Revamping hardware persistency models: view-based and axiomatic persistency models for Intel-X86 and Armv8. In: Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation, PLDI 2021. Virtual, Canada, pp. 16–31. Association for Computing Machinery (2021). https://doi.org/10.1145/3453483.3454027. ISBN 9781450383912

  4. Cytron, R., Ferrante, J., Rosen, B.K., Wegman, M.N., Kenneth Zadeck, F.: Efficiently computing static single assignment form and the control dependence graph. ACM Trans. Program. Lang. Syst. 13(4), 451–490 (1991). https://doi.org/10.1145/115372.115320. ISSN 0164-0925

  5. Davis, M., Logemann, G., Loveland, D.: A machine program for theorem-proving. Commun. ACM 5(7), 394–397 (1962). https://doi.org/10.1145/368273.368557. ISSN 0001-0782

  6. Davis, M., Putnam, H.: A computing procedure for quantification theory. J. ACM 7(3), 201–215 (1960). https://doi.org/10.1145/321033.321034. ISSN 0004-5411

  7. Friedman, M., Herlihy, M., Marathe, V., Petrank, E.: A persistent lock-free queue for non-volatile memory. In: Proceedings of the 23rd ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPoPP 2018, Vienna, Austria, pp. 28–40. Association for Computing Machinery (2018). https://doi.org/10.1145/3178487.3178490. ISBN 9781450349826

  8. Frigioni, D., Miller, T., Nanni, U., Zaroliagis, C.: An experimental study of dynamic algorithms for transitive closure. ACM J. Exp. Algorithmics 6, 9-es (2002). https://doi.org/10.1145/945394.945403. ISSN 1084-6654

  9. Ganzinger, H., Hagen, G., Nieuwenhuis, R., Oliveras, A., Tinelli, C.: DPLL(T): fast decision procedures. In: Alur, R., Peled, D.A. (eds.) CAV 2004. LNCS, vol. 3114, pp. 175–188. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-540-27813-9_14 ISBN 978-3-540-27813-9

    Chapter  Google Scholar 

  10. Gorjiara, H., Xu, G.H., Demsky, B.: Jaaru: efficiently model checking persistent memory programs. In: Proceedings of the 26th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, pp. 415–428. Association for Computing Machinery, New York (2021). https://doi.org/10.1145/3445814.3446735. ISBN 9781450383172

  11. He, F., Sun, Z., Fan, H.: Satisfiability modulo ordering consistency theory for multi-threaded program verification. In: Proceedings of the 42nd CM SIGPLAN International Conference on Programming Language Design and Implementation, PLDI 2021. Virtual, Canada, pp. 1264–1279. Association for Computing Machinery (2021). https://doi.org/10.1145/3453483.3454108. ISBN 9781450383912

  12. Italiano, G.F.: Amortized efficiency of a path retrieval data structure. Theor. Comput. Sci. 48(2-3), 273–281 (1987). ISSN 0304-3975

    Google Scholar 

  13. Izraelevitz, J., Mendes, H., Scott, M.L.: Linearizability of persistent memory objects under a full-system-crash failure model. In: Gavoille, C., Ilcinkas, D. (eds.) DISC 2016. LNCS, vol. 9888, pp. 313–327. Springer, Heidelberg (2016). https://doi.org/10.1007/978-3-662-53426-7_23 ISBN 978-3-662-53425-0

    Chapter  Google Scholar 

  14. Khyzha, A., Lahav, O.: Taming X86-TSO persistency. Proc. ACM Program. Lang. 5(POPL) (2021). https://doi.org/10.1145/3434328

  15. Kokologiannakis, M., Kaysin, I., Raad, A., Vafeiadis, V.: PerSeVerE: persistency semantics for verification under ext4. Proc. ACM Program. Lang. 5(POPL) (2021). https://doi.org/10.1145/3434324

  16. Lamport, L.: How to make a multiprocessor computer that correctly executes multiprocess programs. IEEE Trans. Computers 28(9), 690–691 (1979). https://doi.org/10.1109/TC.1979.1675439

  17. Lantz, P., Dulloor, S., Kumar, S., Sankaran, R., Jackson, J.: Yat: a validation framework for persistent memory software. In: Proceedings of the 2014 USENIX Conference on USENIX Annual Technical Conference, USENIX ATC 2014, pp. 433–438. USENIX Association, Philadelphia (2014). ISBN 9781931971102

    Google Scholar 

  18. Liu, S., Wei, Y., Zhao, J., Kolli, A., Khan, S.M.: PMTest: a fast and flexible testing framework for persistent memory programs. In: Bahar, I., Herlihy, M., Witchel, E., Lebeck, A.R. (eds.) ASPLOS 2019, pp. 411–425. ACM (2019). https://doi.org/10.1145/3297858.3304015

  19. de Moura, L., Bjørner, N.: Z3: an efficient SMT solver. In: Ramakrishnan, C.R., Rehof, J. (eds.) TACAS 2008. LNCS, vol. 4963, pp. 337–340. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-78800-3_24 ISBN 978-3-540-78800-3

    Chapter  Google Scholar 

  20. Oukid, I., Booss, D., Lespinasse, A., Lehner, W.: On testing persistent-memory-based software. In: DaMoN 2016. ACM (2016). https://doi.org/10.1145/2933349.2933354. ISBN 9781450343190

  21. Owens, S., Sarkar, S., Sewell, P.: A better x86 memory model: x86-TSO. In: Berghofer, S., Nipkow, T., Urban, C., Wenzel, M. (eds.) TPHOLs 2009. LNCS, vol. 5674, pp. 391–407. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-03359-9_27 ISBN 978-3-642-03358-2

    Chapter  Google Scholar 

  22. Raad, A., Maranget, L., Vafeiadis, V.: Extending Intel-X86 consistency and persistency: formalising the semantics of Intel-X86 memory types and non-temporal stores. Proc. ACM Program. Lang. 6(POPL) (2022). https://doi.org/10.1145/3498683

  23. Raad, A., Vafeiadis, V.: Persistence semantics for weak memory: integrating epoch persistency with the TSO memory model. Proc. ACM Program. Lang. 2(OOPSLA) (2018). https://doi.org/10.1145/3276507

  24. Raad, A., Wickerson, J., Neiger, G., Vafeiadis, V.: Persistency semantics of the Intel-x86 architecture. Proc. ACM Program. Lang. 4(POPL), 11:1–11:31 (2019). https://doi.org/10.1145/3371079. Accessed 17 June 2020

  25. Raad, A., Wickerson, J., Vafeiadis, V.: Weak persistency semantics from the ground up. Proc. ACM Program. Lang. 3(OOPSLA), 135:1–135:27 (2019). https://doi.org/10.1145/3360561. Accessed 07 Feb 2020

  26. Wei, Y., Ben-David, N., Friedman, M., Blelloch, G.E., Petrank, E.: FliT: a library for simple and efficient persistent algorithms. CoRR abs/2108.04202 (2021). arXiv:2108.04202

  27. Yin, L., Dong, W., Liu, W., Wang, J.: Scheduling constraint based abstraction refinement for multi-threaded program verification. IEEE Trans. Softw. Eng. (2017). https://doi.org/10.1109/TSE.2018.2864122

  28. Yin, L., Dong, W., Liu, W., Wang, J.: Scheduling constraint based abstraction refinement for weak memory models. In: Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering, pp. 645–655. Association for Computing Machinery, New York (2018). https://doi.org/10.1145/3238147.3238223. ISBN 9781450359375

  29. Zuriel, Y., Friedman, M., Sheffi, G., Cohen, N., Petrank, E.: Efficient lock-free durable sets. Proc. ACM Program. Lang. 3(OOPSLA) (2019). https://doi.org/10.1145/3360554

Download references

Acknowledgments

We would like to thank the reviewers for their comments. This work was supported by the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No. 101003349).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Iason Marmanis .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Marmanis, I., Vafeiadis, V. (2023). SMT-Based Verification of Persistency Invariants of Px86 Programs. In: Lal, A., Tonetta, S. (eds) Verified Software. Theories, Tools and Experiments.. VSTTE 2022. Lecture Notes in Computer Science, vol 13800. Springer, Cham. https://doi.org/10.1007/978-3-031-25803-9_6

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-25803-9_6

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-25802-2

  • Online ISBN: 978-3-031-25803-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics