迄今为止从社区验证 Rust 标准库的努力中吸取的经验教训(进行中)
Lessons Learned So Far From a Community Effort to Verify the Rust Standard Library (work-in-progress)
AI总结:
本文总结了社区验证 Rust 标准库(尤其是 unsafe 代码)的进展与经验,回顾了主要工具及其优缺点,并针对根本性障碍提出解决方案,以指导未来验证工作。
摘要:
尽管 Rust 主要旨在成为一种排除未定义行为的安全编程语言,但它为用户提供了 unsafe Rust 这一逃生舱口,允许他们绕过其一些强大的编译时检查。这种额外的自由具有一些优势,包括可能更高效的代码,这也是 unsafe 代码在 Rust 标准库中被广泛使用的主要原因之一。然而,由于 unsafe 代码也重新打开了未定义行为的大门,亚马逊召集了一个社区来验证标准库的安全性,特别是其中包含的 unsafe 代码。鉴于这项工作是在公开场合进行的、开源的,并且得到了大量参与(至少来自 50 位不同的贡献者),我们能够获得大量关于人们如何验证标准库的信息,以及目前可能做到的事情和对于验证软件而言仍似乎超出当前技术水平的事情。在本文中,我们讨论了迄今为止从这项验证工作中吸取的经验教训,既包括我们自己的工作经验,也包括更广泛社区的经验。具体来说,我们首先回顾了迄今已取得的成就,以及使用的主要工具(特别是它们的优点和局限性)。然后,我们重点关注验证标准库所面临的一些剩余的根本性障碍,并提出克服这些障碍的潜在解决方案。我们希望这些观察不仅能指导标准库的未来验证,也能指导一般 unsafe Rust 代码的验证。
英文摘要:
Although Rust primarily intends to be a safe programming language that excludes undefined behaviour, it provides its users with the escape hatch of unsafe Rust, allowing them to circumvent some of its strong compile-time checks. This additional freedom has some advantages, including potentially more efficient code, which is one of the main reasons why unsafe code is used extensively throughout Rust's standard library. However, because unsafe code also re-opens the door to undefined behaviour, Amazon has convened a community to verify the safety of the standard library, and in particular the unsafe code contained therein. Given that this effort is done in public, is open-sourced, and has seen significant participation (from at least 50 different contributors), we have access to a wealth of information on how people are verifying the standard library, as well as what is currently possible and what still appears to be beyond the state of the art for verified software. In this paper, we discuss the lessons learned thus far from this verification effort, from both our work on it, as well as that of the broader community. In particular, we start by reviewing what has been accomplished thus far, as well as the main tools used (specifically, their advantages and their limitations). We then focus on some of the remaining fundamental obstacles to verifying the standard library, and propose potential solutions to overcome them. We hope that these observations can guide future verification of not only the standard library, but also unsafe Rust code in general.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。