Skip to content

Conversation

azhogin
Copy link
Contributor

@azhogin azhogin commented Mar 20, 2025

Depends on bool flag fix: #138483.

Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer

For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier.

Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with -C unsafe-allow-abi-mismatch.

@rustbot
Copy link
Collaborator

rustbot commented Mar 20, 2025

r? @BoxyUwU

rustbot has assigned @BoxyUwU.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 20, 2025
@rust-log-analyzer

This comment has been minimized.

@azhogin azhogin force-pushed the azhogin/sanitizers-target-modificators branch from 7526d38 to 0777169 Compare March 20, 2025 12:59
@rust-log-analyzer

This comment has been minimized.

@azhogin azhogin force-pushed the azhogin/sanitizers-target-modificators branch from 0777169 to f454b02 Compare March 24, 2025 08:53
@rustbot rustbot added the PG-exploit-mitigations Project group: Exploit mitigations label Mar 24, 2025
@rust-log-analyzer

This comment has been minimized.

@azhogin azhogin force-pushed the azhogin/sanitizers-target-modificators branch from f454b02 to 509e0b3 Compare March 24, 2025 09:37
@rust-log-analyzer

This comment has been minimized.

@azhogin azhogin force-pushed the azhogin/sanitizers-target-modificators branch from 509e0b3 to 1f20a51 Compare March 24, 2025 11:33
@rust-log-analyzer

This comment has been minimized.

@azhogin azhogin force-pushed the azhogin/sanitizers-target-modificators branch from 1f20a51 to fc95e77 Compare March 24, 2025 13:14
@rust-log-analyzer

This comment has been minimized.

@azhogin azhogin force-pushed the azhogin/sanitizers-target-modificators branch 2 times, most recently from e025a55 to c54dcfc Compare March 24, 2025 13:40
@azhogin azhogin marked this pull request as ready for review March 24, 2025 14:46
@rustbot
Copy link
Collaborator

rustbot commented Mar 24, 2025

Some changes occurred in tests/codegen/sanitizer

cc @rust-lang/project-exploit-mitigations, @rcvalle

Some changes occurred in tests/ui/sanitizer

cc @rust-lang/project-exploit-mitigations, @rcvalle

@bors
Copy link
Collaborator

bors commented Mar 26, 2025

☔ The latest upstream changes (presumably #138974) made this pull request unmergeable. Please resolve the merge conflicts.

@BoxyUwU
Copy link
Member

BoxyUwU commented Mar 26, 2025

r? compiler

@Darksonn
Copy link
Contributor

Do we have any tests that check simultaneous use of multiple sanitizers? For example, if I enable both shadow-call-stack and kcfi at the same time, then both must also be enabled in deps.

@rcvalle rcvalle added the A-sanitizers Area: Sanitizers for correctness and code quality label Apr 10, 2025
@rcvalle
Copy link
Member

rcvalle commented Apr 10, 2025

@rustbot claim

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Aug 19, 2025
…t modifiers with custom consistency check function
@azhogin azhogin force-pushed the azhogin/sanitizers-target-modificators branch from 649e9a9 to 6d637df Compare August 21, 2025 09:10
@rustbot
Copy link
Collaborator

rustbot commented Aug 21, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rcvalle
Copy link
Member

rcvalle commented Aug 26, 2025

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 26, 2025
@rcvalle
Copy link
Member

rcvalle commented Aug 29, 2025

@bors p=1

@rcvalle
Copy link
Member

rcvalle commented Sep 2, 2025

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 2, 2025

📌 Commit 6d637df has been approved by rcvalle

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Sep 2, 2025

⌛ Testing commit 6d637df with merge c88a42d...

bors added a commit that referenced this pull request Sep 2, 2025
…s, r=rcvalle

Sanitizers target modificators

Depends on bool flag fix: #138483.

Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer

For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier.

Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-20-3 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [ui] tests/ui/sanitizer/cfi/no_builtins.rs stdout ----

error: test compilation failed although it shouldn't!
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/checkout/tests/ui/sanitizer/cfi/no_builtins.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/sanitizer/cfi/no_builtins" "-A" "unused" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Clinker-plugin-lto" "-Copt-level=0" "-Zsanitizer=cfi" "-Ctarget-feature=-crt-static" "--crate-type" "rlib"
stdout: none
--- stderr -------------------------------
error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `no_builtins`
##[error]  --> /checkout/tests/ui/sanitizer/cfi/no_builtins.rs:9:1
   |
LL | #![no_builtins]
   | ^
   |
   = help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
   = note: `-Zsanitizer=cfi` in this crate is incompatible with unset `-Zsanitizer` in dependency `core`
   = help: unset `-Zsanitizer` in this crate or set `-Zsanitizer=cfi` in `core`
   = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer` to silence this error

error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `no_builtins`
##[error]  --> /checkout/tests/ui/sanitizer/cfi/no_builtins.rs:9:1
   |
LL | #![no_builtins]
   | ^
   |
   = help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
   = note: `-Zsanitizer=cfi` in this crate is incompatible with unset `-Zsanitizer` in dependency `compiler_builtins`
   = help: unset `-Zsanitizer` in this crate or set `-Zsanitizer=cfi` in `compiler_builtins`
   = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer` to silence this error

error: aborting due to 2 previous errors
------------------------------------------

---- [ui] tests/ui/sanitizer/cfi/no_builtins.rs stdout end ----

@bors
Copy link
Collaborator

bors commented Sep 3, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 3, 2025
@rcvalle
Copy link
Member

rcvalle commented Sep 4, 2025

This was affected by the test added in #145368. Let's try it again since #145368 had to be reverted and was reverted in #146133.

@rcvalle
Copy link
Member

rcvalle commented Sep 4, 2025

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 4, 2025

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Collaborator

bors commented Sep 4, 2025

📌 Commit 6d637df has been approved by rcvalle

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 4, 2025
@bors
Copy link
Collaborator

bors commented Sep 4, 2025

⌛ Testing commit 6d637df with merge b3cfb8f...

@bors
Copy link
Collaborator

bors commented Sep 5, 2025

☀️ Test successful - checks-actions
Approved by: rcvalle
Pushing b3cfb8f to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 5, 2025
@bors bors merged commit b3cfb8f into rust-lang:master Sep 5, 2025
11 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Sep 5, 2025
Copy link
Contributor

github-actions bot commented Sep 5, 2025

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 af00ff2 (parent) -> b3cfb8f (this PR)

Test differences

Show 36 test diffs

Stage 1

  • [ui] tests/ui/target_modifiers/sanitizer-kcfi-normalize-ints.rs#ok: [missing] -> pass (J5)
  • [ui] tests/ui/target_modifiers/sanitizer-kcfi-normalize-ints.rs#wrong_flag: [missing] -> pass (J5)
  • [ui] tests/ui/target_modifiers/sanitizer-kcfi-normalize-ints.rs#wrong_sanitizer: [missing] -> pass (J5)
  • [ui] tests/ui/target_modifiers/sanitizers-good-for-inconsistency.rs#wrong_address_san: [missing] -> pass (J5)
  • [ui] tests/ui/target_modifiers/sanitizers-good-for-inconsistency.rs#wrong_leak_san: [missing] -> pass (J5)
  • [ui] tests/ui/target_modifiers/sanitizers-safestack-and-kcfi.rs#good: [missing] -> pass (J5)
  • [ui] tests/ui/target_modifiers/sanitizers-safestack-and-kcfi.rs#good_reverted: [missing] -> pass (J5)
  • [ui] tests/ui/target_modifiers/sanitizers-safestack-and-kcfi.rs#missed_both: [missing] -> pass (J5)
  • [ui] tests/ui/target_modifiers/sanitizers-safestack-and-kcfi.rs#missed_kcfi: [missing] -> pass (J5)
  • [ui] tests/ui/target_modifiers/sanitizers-safestack-and-kcfi.rs#missed_safestack: [missing] -> pass (J5)

Stage 2

  • [ui] tests/ui/target_modifiers/sanitizers-good-for-inconsistency.rs#wrong_leak_san: [missing] -> pass (J0)
  • [ui] tests/ui/target_modifiers/sanitizer-kcfi-normalize-ints.rs#ok: [missing] -> ignore (ignored on targets without kernel CFI sanitizer) (J1)
  • [ui] tests/ui/target_modifiers/sanitizer-kcfi-normalize-ints.rs#wrong_flag: [missing] -> ignore (ignored on targets without kernel CFI sanitizer) (J1)
  • [ui] tests/ui/target_modifiers/sanitizer-kcfi-normalize-ints.rs#wrong_sanitizer: [missing] -> ignore (ignored on targets without kernel CFI sanitizer) (J1)
  • [ui] tests/ui/target_modifiers/sanitizers-safestack-and-kcfi.rs#good: [missing] -> pass (J2)
  • [ui] tests/ui/target_modifiers/sanitizers-safestack-and-kcfi.rs#good_reverted: [missing] -> pass (J2)
  • [ui] tests/ui/target_modifiers/sanitizers-safestack-and-kcfi.rs#missed_both: [missing] -> pass (J2)
  • [ui] tests/ui/target_modifiers/sanitizers-safestack-and-kcfi.rs#missed_kcfi: [missing] -> pass (J2)
  • [ui] tests/ui/target_modifiers/sanitizers-safestack-and-kcfi.rs#missed_safestack: [missing] -> pass (J2)
  • [ui] tests/ui/target_modifiers/sanitizers-safestack-and-kcfi.rs#good: [missing] -> ignore (ignored on targets without SafeStack support) (J3)
  • [ui] tests/ui/target_modifiers/sanitizers-safestack-and-kcfi.rs#good_reverted: [missing] -> ignore (ignored on targets without SafeStack support) (J3)
  • [ui] tests/ui/target_modifiers/sanitizers-safestack-and-kcfi.rs#missed_both: [missing] -> ignore (ignored on targets without SafeStack support) (J3)
  • [ui] tests/ui/target_modifiers/sanitizers-safestack-and-kcfi.rs#missed_kcfi: [missing] -> ignore (ignored on targets without SafeStack support) (J3)
  • [ui] tests/ui/target_modifiers/sanitizers-safestack-and-kcfi.rs#missed_safestack: [missing] -> ignore (ignored on targets without SafeStack support) (J3)
  • [ui] tests/ui/target_modifiers/sanitizer-kcfi-normalize-ints.rs#ok: [missing] -> pass (J4)
  • [ui] tests/ui/target_modifiers/sanitizer-kcfi-normalize-ints.rs#wrong_flag: [missing] -> pass (J4)
  • [ui] tests/ui/target_modifiers/sanitizer-kcfi-normalize-ints.rs#wrong_sanitizer: [missing] -> pass (J4)
  • [ui] tests/ui/target_modifiers/sanitizers-good-for-inconsistency.rs#wrong_leak_san: [missing] -> ignore (ignored on targets without leak sanitizer) (J6)
  • [ui] tests/ui/target_modifiers/sanitizers-good-for-inconsistency.rs#wrong_address_san: [missing] -> pass (J7)
  • [ui] tests/ui/target_modifiers/sanitizers-good-for-inconsistency.rs#wrong_address_san: [missing] -> ignore (ignored on targets without address sanitizer) (J8)

Additionally, 6 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard b3cfb8faf84c5f3b7909479a9f9b6a3290d5f4d7 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-aarch64-linux: 8784.2s -> 5813.9s (-33.8%)
  2. i686-gnu-2: 5343.0s -> 6378.1s (19.4%)
  3. i686-gnu-nopt-1: 7500.0s -> 8746.2s (16.6%)
  4. aarch64-gnu-llvm-19-2: 2238.7s -> 2604.3s (16.3%)
  5. x86_64-gnu-tools: 3305.3s -> 3792.3s (14.7%)
  6. x86_64-gnu-llvm-19: 2393.6s -> 2739.3s (14.4%)
  7. aarch64-gnu-llvm-19-1: 3173.7s -> 3621.8s (14.1%)
  8. dist-apple-various: 3866.7s -> 4312.6s (11.5%)
  9. x86_64-rust-for-linux: 2634.0s -> 2929.7s (11.2%)
  10. i686-gnu-1: 7635.2s -> 8369.9s (9.6%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b3cfb8f): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (secondary -0.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.4% [2.3%, 4.6%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.0% [-5.1%, -1.8%] 3
All ❌✅ (primary) - - 0

Cycles

Results (primary -2.6%, secondary 0.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.3% [4.3%, 4.3%] 1
Improvements ✅
(primary)
-2.6% [-2.6%, -2.6%] 1
Improvements ✅
(secondary)
-3.4% [-3.4%, -3.4%] 1
All ❌✅ (primary) -2.6% [-2.6%, -2.6%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 467.269s -> 467.377s (0.02%)
Artifact size: 390.49 MiB -> 390.50 MiB (0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs A-sanitizers Area: Sanitizers for correctness and code quality merged-by-bors This PR was explicitly merged by bors. PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

Successfully merging this pull request may close these issues.