Skip to content

Commit d20b238

Browse files
committed
Auto merge of #147935 - luca3s:add-rtsan, r=petrochenkov
Add LLVM realtime sanitizer This is a new attempt at adding the [LLVM real-time sanitizer](https://clang.llvm.org/docs/RealtimeSanitizer.html) to rust. Previously this was attempted in rust-lang/rfcs#3766. Since then the `sanitize` attribute was introduced in rust-lang/rust#142681 and it is a lot more flexible than the old `no_santize` attribute. This allows adding real-time sanitizer without the need for a new attribute, like it was proposed in the RFC. Because i only add a new value to a existing command line flag and to a attribute i don't think an MCP is necessary. Currently real-time santizer is usable in rust code with the [rtsan-standalone](https://crates.io/crates/rtsan-standalone) crate. This downloads or builds the sanitizer runtime and then links it into the rust binary. The first commit adds support for more detailed sanitizer information. The second commit then actually adds real-time sanitizer. The third adds a warning against using real-time sanitizer with async functions, cloures and blocks because it doesn't behave as expected when used with async functions. I am not sure if this is actually wanted, so i kept it in a seperate commit. The fourth commit adds the documentation for real-time sanitizer.
2 parents e700ae5 + a4620ae commit d20b238

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sanitizers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ implementation:
4545
[marked][sanitizer-attribute] with appropriate LLVM attribute:
4646
`SanitizeAddress`, `SanitizeHWAddress`, `SanitizeMemory`, or
4747
`SanitizeThread`. By default all functions are instrumented, but this
48-
behaviour can be changed with `#[sanitize(xyz = "on|off")]`.
48+
behaviour can be changed with `#[sanitize(xyz = "on|off|<other>")]`.
4949

5050
* The decision whether to perform instrumentation or not is possible only at a
5151
function granularity. In the cases were those decision differ between

0 commit comments

Comments
 (0)