-
Notifications
You must be signed in to change notification settings - Fork 14k
Add LLVM realtime sanitizer #147935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add LLVM realtime sanitizer #147935
Conversation
|
Some changes occurred in tests/ui/sanitizer cc @rcvalle Some changes occurred in src/tools/compiletest cc @jieyouxu Some changes occurred in compiler/rustc_codegen_ssa Some changes occurred in compiler/rustc_hir/src/attrs These commits modify compiler targets. Some changes occurred in src/doc/unstable-book/src/compiler-flags/sanitizer.md cc @rust-lang/project-exploit-mitigations, @rcvalle Some changes occurred in compiler/rustc_attr_parsing This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp. Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt The rustc-dev-guide subtree was changed. If this PR only touches the dev guide consider submitting a PR directly to rust-lang/rustc-dev-guide otherwise thank you for updating the dev guide with your changes. cc @BoxyUwU, @jieyouxu, @Kobzol, @tshepang Some changes occurred in compiler/rustc_passes/src/check_attr.rs |
|
rustbot has assigned @petrochenkov. Use |
|
Looks ok from attr parsing pov :) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
|
This change has a lang component (marking functions a blocking or non-blocking), so I'll send this to lang team first, before reviewing the implementation in detail. |
|
Thanks for checking with us. We talked about this in the lang meeting today. We were OK with this going forward experimentally in nightly. We talked about how, ahead of stabilization, we'd like to see the feature flags for the individual sanitizers be separate to facilitate our review, as we're likely to want to stabilize these incrementally. |
|
💔 Test failed - checks-actions |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
This comment was marked as outdated.
This comment was marked as outdated.
|
CI issues seem to be resolved. Could i get a bors retry? |
|
@bors retry |
|
☀️ Test successful - checks-actions |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing bbb6f68 (parent) -> 87f9dcd (this PR) Test differencesShow 591 test diffsStage 1
Stage 2
Additionally, 575 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 87f9dcd5e28a301fce81515bd4bea792444dcf29 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (87f9dcd): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowOur benchmarks found a performance regression caused by this PR. Next Steps:
@rustbot label: +perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 0.7%, secondary 0.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 3.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.0%, secondary 0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 474.693s -> 475.809s (0.24%) |
|
Only thing i can imagine causing a regression is the new lint. Otherwise i added one byte (+ maybe padding) to CodegenFnAttrs, which shouldn't make a difference (i guess)? And one new option to the sanitize attr parser, but i don't think the regressed crates even use the sanitize attribute. syn, the improvement looks really noisy. This PR shouldn't improve perf in any case. |
Fix typo in unstable-book link This prevented the links from being rendered. Sorry for not noticing this before my changes were merged yesterday. Introduced in rust-lang#147935 cc `@petrochenkov`
Fix typo in unstable-book link This prevented the links from being rendered. Sorry for not noticing this before my changes were merged yesterday. Introduced in rust-lang#147935 cc ``@petrochenkov``
Fix typo in unstable-book link This prevented the links from being rendered. Sorry for not noticing this before my changes were merged yesterday. Introduced in rust-lang/rust#147935 cc ``@petrochenkov``
This is a new attempt at adding the LLVM real-time sanitizer to rust.
Previously this was attempted in rust-lang/rfcs#3766.
Since then the
sanitizeattribute was introduced in #142681 and it is a lot more flexible than the oldno_santizeattribute. 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 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.