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

RustBelt meets relaxed memory

Published:20 December 2019Publication History
Skip Abstract Section

Abstract

The Rust programming language supports safe systems programming by means of a strong ownership-tracking type system. In their prior work on RustBelt, Jung et al. began the task of setting Rust’s safety claims on a more rigorous formal foundation. Specifically, they used Iris, a Coq-based separation logic framework, to build a machine-checked proof of semantic soundness for a λ-calculus model of Rust, as well as for a number of widely-used Rust libraries that internally employ unsafe language features. However, they also made the significant simplifying assumption that the language is sequentially consistent. In this paper, we adapt RustBelt to account for the relaxed-memory operations that concurrent Rust libraries actually use, in the process uncovering a data race in the Arc library. We focus on the most interesting technical problem: how to reason about resource reclamation under relaxed memory, using a logical construction we call synchronized ghost state.

Skip Supplemental Material Section

Supplemental Material

a34-dang.webm

References

  1. Amal Ahmed, Andrew W. Appel, Christopher D. Richards, Kedar N. Swadi, Gang Tan, and Daniel C. Wang. 2010. Semantic foundations for typed assembly languages. TOPLAS 32, 3 (2010), 1–67.Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Mark Batty, Scott Owens, Susmit Sarkar, Peter Sewell, and Tjark Weber. 2011. Mathematizing C++ concurrency. In POPL. 55–66.Google ScholarGoogle Scholar
  3. Hans-J. Boehm and Brian Demsky. 2014. Outlawing ghosts: Avoiding out-of-thin-air results. In MSPC.Google ScholarGoogle Scholar
  4. Richard Bornat, Cristiano Calcagno, Peter W. O’Hearn, and Matthew J. Parkinson. 2005. Permission accounting in separation logic. (2005), 259–270. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. John Boyland. 2003. Checking interference with fractional permissions. In SAS (LNCS). Google ScholarGoogle ScholarCross RefCross Ref
  6. David Chase and Yossi Lev. 2005. Dynamic circular work-stealing deque. In SPAA. 21–28. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Hoang-Hai Dang, Jacques-Henri Jourdan, Jan-Oliver Kaiser, and Derek Dreyer. 2019. RustBelt meets relaxed memory – Artifact. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Simon Doherty, Brijesh Dongol, Heike Wehrheim, and John Derrick. 2019. Verifying C11 programs operationally. In PPoPP. 355–365. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Marko Doko and Viktor Vafeiadis. 2016. A program logic for C11 memory fences. In VMCAI (LNCS). Springer, 413–430.Google ScholarGoogle Scholar
  10. Marko Doko and Viktor Vafeiadis. 2017. Tackling real-life relaxed concurrency with FSL++. In ESOP.Google ScholarGoogle Scholar
  11. Derek Dreyer. 2016. RustBelt project webpage. http://plv.mpi-sws.org/rustbelt/Google ScholarGoogle Scholar
  12. Alexey Gotsman, Josh Berdine, Byron Cook, Noam Rinetzky, and Mooly Sagiv. 2007. Local reasoning for storable locks and threads. In APLAS. 19–37.Google ScholarGoogle Scholar
  13. Mengda He, Viktor Vafeiadis, Shengchao Qin, and João F. Ferreira. 2018. GPS+: Reasoning about fences and relaxed atomics. International Journal of Parallel Programming 46, 6 (2018), 1157–1183. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Aquinas Hobor, Andrew W. Appel, and Francesco Zappa Nardelli. 2008. Oracle semantics for concurrent separation logic. In ESOP. 353–367.Google ScholarGoogle Scholar
  15. Jacques-Henri Jourdan. 2018. Insufficient synchronization in Arc::get_mut. Rust issue #51780, https://github.com/rustlang/rust/issues/51780 .Google ScholarGoogle Scholar
  16. Ralf Jung, Jacques-Henri Jourdan, Robbert Krebbers, and Derek Dreyer. 2018a. RustBelt: Securing the foundations of the Rust programming language. PACMPL 2, POPL, Article 66 (2018).Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Ralf Jung, Robbert Krebbers, Jacques-Henri Jourdan, Aleš Bizjak, Lars Birkedal, and Derek Dreyer. 2018b. Iris from the ground up: A modular foundation for higher-order concurrent separation logic. Journal of Functional Programming 28, e20 (Nov. 2018), 1–73. Google ScholarGoogle ScholarCross RefCross Ref
  18. 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 (LIPIcs). 17:1–17:29.Google ScholarGoogle Scholar
  19. Jeehoon Kang, Chung-Kil Hur, Ori Lahav, Viktor Vafeiadis, and Derek Dreyer. 2017. A promising semantics for relaxedmemory concurrency. In POPL. ACM, 175–189.Google ScholarGoogle Scholar
  20. Steve Klabnik and Carol Nichols. 2018. The Rust Programming Language. https://doc.rust-lang.org/stable/book/2018-edition/Google ScholarGoogle Scholar
  21. Robbert Krebbers, Jacques-Henri Jourdan, Ralf Jung, Joseph Tassarotti, Jan-Oliver Kaiser, Amin Timany, Arthur Charguéraud, and Derek Dreyer. 2018. MoSeL: A general, extensible modal framework for interactive proofs in separation logic. PACMPL 2, ICFP, Article 77 (2018).Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Robbert Krebbers, Amin Timany, and Lars Birkedal. 2017. Interactive proofs in higher-order concurrent separation logic. In POPL . Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Ori Lahav, Viktor Vafeiadis, Jeehoon Kang, Chung-Kil Hur, and Derek Dreyer. 2017. Repairing sequential consistency in C/C++11. In PLDI.Google ScholarGoogle Scholar
  24. Leslie Lamport. 1979. How to make a multiprocessor computer that correctly executes multiprocess programs. IEEE Trans. Computers 28, 9 (1979), 690–691.Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Anton Podkopaev, Ilya Sergey, and Aleksandar Nanevski. 2016. Operational aspects of C/C++ concurrency. CoRR abs/1606.01400 (2016). arXiv: 1606.01400 http://arxiv.org/abs/1606.01400Google ScholarGoogle Scholar
  26. John C. Reynolds. 2002. Separation logic: A logic for shared mutable data structures. In LICS. Google ScholarGoogle ScholarCross RefCross Ref
  27. Kasper Svendsen, Jean Pichon-Pharabod, Marko Doko, Ori Lahav, and Viktor Vafeiadis. 2018. A separation logic for a promising semantics. In ESOP. 357–384. Google ScholarGoogle ScholarCross RefCross Ref
  28. Joseph Tassarotti, Derek Dreyer, and Viktor Vafeiadis. 2015. Verifying read-copy-update in a logic for weak memory. In PLDI . 110–120. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Aaron Turon. 2016. Crossbeam: Support for concurrent and parallel programming. Available at https://github.com/aturon/ crossbeam .Google ScholarGoogle Scholar
  30. Aaron Turon, Viktor Vafeiadis, and Derek Dreyer. 2014. GPS: Navigating weak memory with ghosts, protocols, and separation. In OOPSLA. ACM, 691–707.Google ScholarGoogle Scholar
  31. Viktor Vafeaidis and Chinmay Narayan. 2013. Relaxed separation logic: A program logic for C11 concurrency. In OOPSLA.Google ScholarGoogle Scholar

Index Terms

  1. RustBelt meets relaxed memory

        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
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!