Concrat: An Automatic C-to-Rust Lock API Translator for Concurrent Programs
Jaemin Hong, Sukyoung Ryu

TL;DR
Concrat is an automated tool that translates C lock API usage to Rust's safe lock API, enabling safer concurrent program rewriting with minimal manual effort.
Contribution
It introduces a scalable, precise static analysis and code transformation approach to automatically replace C lock APIs with Rust equivalents.
Findings
Transforms 66 KLOC in 2.6 seconds
Handles 74% of real-world programs
Provides a scalable, semantics-preserving translation process
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsParallel Computing and Optimization Techniques · Logic, programming, and type systems · Software Testing and Debugging Techniques
