Concrat: An Automatic C-to-Rust Lock API Translator for Concurrent Programs
Jaemin Hong, Sukyoung Ryu
摘要
Concurrent programs suffer from data races. To prevent data races, programmers use locks. However, programs can eliminate data races only when they acquire and release correct locks at correct timing. The lock API of C, in which people have developed a large portion of legacy system programs, does not validate the correct use of locks. On the other hand, Rust, a recently developed system programming language, provides a lock API that guarantees the correct use of locks via type checking. This makes rewriting legacy system programs in Rust a promising way to retrofit safety into them. Unfortunately, manual C-to-Rust translation is extremely laborious due to the discrepancies between their lock APIs. Even the state-of-the-art automatic C-to-Rust translator retains the C lock API, expecting developers to replace them with the Rust lock API. In this work, we propose an automatic tool to replace the C lock API with the Rust lock API. It facilitates C-to-Rust translation of concurrent programs with less human effort than the current practice. Our tool consists of a Rust code transformer that takes a lock summary as an input and a static analyzer that efficiently generates precise lock summaries. We show that the transformer is scalable and widely applicable while preserving the semantics; it transforms 66 KLOC in 2.6 seconds and successfully handles 74% of real-world programs. We also show that the analyzer is scalable and precise; it analyzes 66 KLOC in 4.3 seconds.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 12 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Scylla: Translating an Applicative Subset of C to Safe Rust 引用了 Translating C to safer Rust
- Scylla: Translating an Applicative Subset of C to Safe Rust 引用了 To Tag, or Not to Tag: Translating C's Unions to Rust's Tagged Unions
- RustAssure: Differential Symbolic Testing for LLM-Transpiled C-to-Rust Code 引用了 Translating C to safer Rust
- To Tag, or Not to Tag: Translating C's Unions to Rust's Tagged Unions 引用了 Translating C to safer Rust
- SmartC2Rust: Iterative, Feedback-Driven C-to-Rust Translation via Large Language Models for Safety and Equivalence 引用了 Translating C to safer Rust
引用它的顶会 Paper12
- RustAssure: Differential Symbolic Testing for LLM-Transpiled C-to-Rust CodeYubo Bai, Tapti PalitASE 2025 · 8 次引用
- Scylla: Translating an Applicative Subset of C to Safe RustAymeric Fromherz, Jonathan ProtzenkoOOPSLA 2026 · 6 次引用
- To Tag, or Not to Tag: Translating C's Unions to Rust's Tagged UnionsJaemin Hong, Sukyoung RyuASE 2024 · 6 次引用
- SIRO: Empowering Version Compatibility in Intermediate Representations via Program SynthesisBowen Zhang, Wei Chen, Peisen Yao, Chengpeng Wang 等ASPLOS 2024 · 4 次引用
- SmartC2Rust: Iterative, Feedback-Driven C-to-Rust Translation via Large Language Models for Safety and EquivalenceMomoko Shiraishi, Yinzhi Cao, Takahiro ShinagawaICSE 2026 · 4 次引用
它引用的 Paper1
相关 Paper
- Aliasing Limits on Translating C to Safe RustMehmet Emre, Peter Boyland, Aesha Parekh, Ryan Schroeder 等OOPSLA 2023 · 32 次引用
- Ownership Guided C to Rust TranslationHanliang Zhang, Cristina David, Yijun Yu, Meng WangCAV 2023 · 37 次引用
- Forcrat: Automatic I/O API Translation from C to Rust via Origin and Capability AnalysisJaemin Hong, Sukyoung RyuASE 2025 · 1 次引用
- &inator: Correct, Precise C-to-Rust Interface TranslationVictor Chen, Ayden Coughlin, Michael D. BondPLDI 2026 · 1 次引用
- GenC2Rust: Towards Generating Generic Rust Code from CXiafa Wu, Brian DemskyICSE 2025 · 4 次引用
