Understanding memory and thread safety practices and issues in real-world Rust programs
Boqin Qin, Yilun Chen, Zeming Yu, Linhai Song, Yiying Zhang
Abstract
Rust is a young programming language designed for systems software development. It aims to provide safety guarantees like high-level languages and performance efficiency like low-level languages. The core design of Rust is a set of strict safety rules enforced by compile-time checking. To support more low-level controls, Rust allows programmers to bypass these compiler checks to write unsafe code.
It is important to understand what safety issues exist in real Rust programs and how Rust safety mechanisms impact programming practices. We performed the first empirical study of Rust by close, manual inspection of 850 unsafe code usages and 170 bugs in five open-source Rust projects, five widely-used Rust libraries, two online security databases, and the Rust standard library. Our study answers three important questions: how and why do programmers write unsafe code, what memory-safety issues real Rust programs have, and what concurrency bugs Rust programmers make. Our study reveals interesting real-world Rust program behaviors and new issues Rust programmers make. Based on our study results, we propose several directions of building Rust bug detectors and built two static bug detectors, both of which revealed previously unknown bugs.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
34 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- QSYM : A Practical Concolic Execution Engine Tailored for Hybrid Fuzzing cites VUzzer: Application-aware Evolutionary Fuzzing
- QSYM : A Practical Concolic Execution Engine Tailored for Hybrid Fuzzing cites Driller: Augmenting Fuzzing Through Selective Symbolic Execution
- QSYM : A Practical Concolic Execution Engine Tailored for Hybrid Fuzzing cites Angora: Efficient Fuzzing by Principled Search
- VUzzer: Application-aware Evolutionary Fuzzing cites Driller: Augmenting Fuzzing Through Selective Symbolic Execution
- Rudra: Finding Memory Safety Bugs in Rust at the Ecosystem Scale cites How do programmers use unsafe rust?
- Rudra: Finding Memory Safety Bugs in Rust at the Ecosystem Scale cites Theseus: an Experiment in Operating System Structure and State Management
- ProFuzzer: On-the-fly Input Type Probing for Better Zero-Day Vulnerability Discovery cites QSYM : A Practical Concolic Execution Engine Tailored for Hybrid Fuzzing
- ProFuzzer: On-the-fly Input Type Probing for Better Zero-Day Vulnerability Discovery cites VUzzer: Application-aware Evolutionary Fuzzing
- ProFuzzer: On-the-fly Input Type Probing for Better Zero-Day Vulnerability Discovery cites Driller: Augmenting Fuzzing Through Selective Symbolic Execution
- ProFuzzer: On-the-fly Input Type Probing for Better Zero-Day Vulnerability Discovery cites Angora: Efficient Fuzzing by Principled Search
- Translating C to safer Rust cites How do programmers use unsafe rust?
- Angora: Efficient Fuzzing by Principled Search cites VUzzer: Application-aware Evolutionary Fuzzing
- Angora: Efficient Fuzzing by Principled Search cites Driller: Augmenting Fuzzing Through Selective Symbolic Execution
Cited by top-tier papers34
- How do programmers use unsafe rust?Vytautas Astrauskas, Christoph Matheja, Federico Poli, Peter Müller et al.OOPSLA 2020 · 78 citations
- Theseus: an Experiment in Operating System Structure and State ManagementKevin Boos, Namitha Liyanage, Ramla Ijaz, Lin ZhongOSDI 2020 · 67 citations
- MirChecker: Detecting Bugs in Rust Programs via Static AnalysisZhuohua Li, Jincheng Wang, Mingshen Sun, John C. S. LuiCCS 2021 · 63 citations
- Rudra: Finding Memory Safety Bugs in Rust at the Ecosystem ScaleYechan Bae, Youngsuk Kim, Ammar Askar, Jungwon Lim et al.SOSP 2021 · 61 citations
- Translating C to safer RustMehmet Emre, Ryan Schroeder, Kyle Dewey, Ben HardekopfOOPSLA 2021 · 60 citations
Builds on7
- Driller: Augmenting Fuzzing Through Selective Symbolic ExecutionNick Stephens, John Grosen, Christopher Salls, Andrew Dutcher et al.NDSS 2016 · 1,021 citations
- VUzzer: Application-aware Evolutionary FuzzingSanjay Rawat, Vivek Jain, Ashish Kumar, Lucian Cojocar et al.NDSS 2017 · 700 citations
- Angora: Efficient Fuzzing by Principled SearchPeng Chen, Hao ChenS&P 2018 · 616 citations
- QSYM : A Practical Concolic Execution Engine Tailored for Hybrid FuzzingInsu Yun, Sangho Lee, Meng Xu, Yeongjin Jang et al.USENIX Security 2018 · 537 citations
- ProFuzzer: On-the-fly Input Type Probing for Better Zero-Day Vulnerability DiscoveryWei You, Xueqiang Wang, Shiqing Ma, Jianjun Huang et al.S&P 2019 · 130 citations
Related papers
- Learning and Programming Challenges of Rust: A Mixed-Methods StudyShuofei Zhu, Ziyi Zhang, Boqin Qin, Aiping Xiong et al.ICSE 2022 · 27 citations
- Is rust used safely by software developers?Ana Nora Evans, Bradford Campbell, Mary Lou SoffaICSE 2020 · 57 citations
- "I wouldn't want my unsafe code to run my pacemaker": An Interview Study on the Use, Comprehension, and Perceived Risks of Unsafe RustSandra Höltervennhoff, Philip Klostermeyer, Noah Wöhler, Yasemin Acar et al.USENIX Security 2023
- Is unsafe an Achilles' Heel? A Comprehensive Study of Safety Requirements in Unsafe Rust ProgrammingMohan Cui, Shuran Sun, Hui Xu, Yangfan ZhouICSE 2024 · 12 citations
- Miri: Practical Undefined Behavior Detection for RustRalf Jung, Benjamin Kimock, Christian Poveda, Eduardo Sánchez Muñoz et al.POPL 2026 · 8 citations
