BorrowSanitizer

Lobsters Hottest Tools

Summary

BorrowSanitizer is an open-source LLVM sanitizer for detecting Rust-specific aliasing violations in multi-language applications, aiming to be fast enough for fuzzing and to support Rust, C, and C++ interop.

<p><a href="https://lobste.rs/s/jkv2du/borrowsanitizer">Comments</a></p>
Original Article
View Cached Full Text

Cached at: 08/04/26, 11:45 AM

# Introduction - BorrowSanitizer Source: [https://borrowsanitizer.com/](https://borrowsanitizer.com/) > Check out our latest[status update](https://borrowsanitizer.com/status/latest)for 2026\! 👀 **BorrowSanitizer**is a dynamic analysis tool for detecting Rust\-specific aliasing bugs in multi\-language applications\. ![the BorrowSanitizer project logo](https://borrowsanitizer.com/images/bsan.svg) The Rust compiler provides powerful,*static*safety guarantees by restricting aliasing and mutability\. However, developers can bypass these restrictions by using a subset of[`unsafe`](https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html)features\. These features are necessary for Rust to interoperate with other languages\. However, if developers use unsafe code incorrectly, then they can break the rules of Rust’s aliasing model, which the compiler relies on to be able to optimize programs\. Incorrect optimizations can introduce security vulnerabilities\. Rust developers can find aliasing bugs using[Miri](https://github.com/rust-lang/miri), an interpreter\. Miri is**the only tool**that can find violations of Rust’s latest[Tree Borrows](https://www.ralfj.de/blog/2023/06/02/tree-borrows.html)aliasing model, but it cannot find these bugs in foreign code\. Miri is also significantly slower than native execution, which makes it impractical to use techniques like fuzzing or property\-based testing to find these Rust\-specific bugs\. BorrowSanitizer is an LLVM sanitizer for finding aliasing violations\. Our goal is for it to be fast enough for use with fuzzing tools and to have support for Rust, C, and C\+\+ in interoperation\. We intend for it to be a production\-ready tool\. Join[our Zulip](https://bsan.zulipchat.com/)if you are interested in contributing or if you have any additional questions about our project\. You can build and test our sanitizer by following the setup instructions in the next section\. All of our code is open\-source and publicly available[on GitHub](https://github.com/borrowsanitizer)\. [https://borrowsanitizer.com/setup.html](https://borrowsanitizer.com/setup.html) [https://borrowsanitizer.com/setup.html](https://borrowsanitizer.com/setup.html)

Similar Articles

An alias-based formulation of the borrow checker (2018)

Hacker News Top

Niko Matsakis describes an alternative alias-based formulation of Rust's borrow checker, where regions are sets of loans rather than program points, with a working prototype that passes the NLL test suite.

you_can::turn_off_the_borrow_checker

Hacker News Top

Introduces a Rust macro that suppresses borrow checker errors for educational purposes, warning it is unsafe for production use.

Valen's Memory Safety: A New Kind of Borrow Checking

Hacker News Top

Valen 的新文章介绍了一种更灵活的借用检查器(group borrowing),编译器会记住引用指向的位置,以实现比 Rust 更简单灵活的内存安全方案,并已被 Google Carbon 等语言采纳。

Borrow-checking without type-checking

Lobsters Hottest

A blog post presents a toy language that enforces borrow-checking at runtime without static typing, using cheap reference-counting on the stack to enable interior pointers and single ownership in a dynamically-typed setting.