Beyond Memory Safety: an Empirical Study on Bugs and Fixes of Rust Programs

被引:1
作者
Zhang, Chengquan [1 ]
Feng, Yang [1 ]
Zhang, Yaokun [1 ]
Dai, Yuxuan [1 ]
Xu, Baowen [1 ]
机构
[1] Nanjing Univ, State Key Lab Novel Software Technol, Nanjing 210023, Peoples R China
来源
2024 IEEE 24TH INTERNATIONAL CONFERENCE ON SOFTWARE QUALITY, RELIABILITY AND SECURITY, QRS | 2024年
关键词
bug study; Rust; bug fix; quality assurance;
D O I
10.1109/QRS62785.2024.00035
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Rust is a nascent programming language designed to improve memory safety for system programming while maintaining high performance. The Rust language ensures memory safety through its ownership mechanism and by performing compile-time checks on safe code. However, for low-level controls, developers are allowed to bypass these checks by marking their code as unsafe, which in turn introduces memory vulnerabilities. Beyond these memory-related concerns, the existence and nature of other common bugs such as run-time panics have not been thoroughly explored. In this paper, we conduct a comprehensive empirical study to characterize bugs and their fixes beyond memory safety concerns by manually inspecting bug patches in Rust programs. We identify 790 bug fixes from 1100 commits in six widely-used Rust projects and the Rust standard library, and then investigate their root causes and symptoms. Furthermore, we analyze the relationships between these bugs and unsafe code (i.e., whether they are caused by the use of unsafe code and to what extent it impacts them). Our bug study introduces a classification of 15 root causes and 6 symptoms, and categorizes bugs into different groups according to their relationships with safe/unsafe code. We identify 19 major findings and draw broader lessons from them to guide the research community towards future directions in program testing, analysis, fault localization, and repair for Rust language.
引用
收藏
页码:272 / 283
页数:12
相关论文
共 41 条
  • [1] Advisory-DB, 2023, Security advisory database for Rust crates published through crates.io
  • [2] Fidelius Charm: Isolating Unsafe Rust Code
    Almohri, Hussain M. J.
    Evans, David
    [J]. PROCEEDINGS OF THE EIGHTH ACM CONFERENCE ON DATA AND APPLICATION SECURITY AND PRIVACY (CODASPY'18), 2018, : 248 - 255
  • [3] Leveraging Rust Types for Modular Specification and Verification
    Astrauskas, Vytautas
    Muller, Peter
    Poli, Federico
    Summers, Alexander J.
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2019, 3 (OOPSLA):
  • [4] How Do Programmers Use Unsafe Rust?
    Astrauskas, Vytautas
    Matheja, Christoph
    Poli, Federico
    Muller, Peter
    Summers, Alexander J.
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2020, 4 (OOPSLA):
  • [5] RUDRA: Finding Memory Safety Bugs in Rust at the Ecosystem Scale
    Bae, Yechan
    Kim, Youngsuk
    Askar, Ammar
    Lim, Jungwon
    Kim, Taesoo
    [J]. PROCEEDINGS OF THE 28TH ACM SYMPOSIUM ON OPERATING SYSTEMS PRINCIPLES, SOSP 2021, 2021, : 84 - 99
  • [6] Cui M., 2022, ACM Transactions on Software Engineering and Methodology
  • [7] Dang H.-H., 2020, P ACM PROGRAM LANG, V4
  • [8] Di Franco A, 2017, IEEE INT CONF AUTOM, P509, DOI 10.1109/ASE.2017.8115662
  • [9] egui, 2023, An immediate mode GUI library written in Rust
  • [10] Evans AN, 2020, PROC INT CONF SOFTW, P246