Skip to content
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

sanitizers: Add documentation for the no_sanitize attribute #1701

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rcvalle
Copy link
Member

@rcvalle rcvalle commented Dec 20, 2024

Add documentation for the no_sanitize attribute, being stabilized in rust-lang/rust#123617 along with AddressSanitizer and LeakSanitizer.

Add documentation for the `no_sanitize` attribute, being stabilized in
rust-lang/rust#123617 along with AddressSanitizer and LeakSanitizer.
@rcvalle rcvalle force-pushed the rust-stabilize-core-sanitizers branch from 8907f6d to a29174a Compare December 20, 2024 05:16
@ehuss ehuss added the S-waiting-on-stabilization Waiting for a stabilization PR to be merged in the main Rust repository label Dec 31, 2024
@ehuss
Copy link
Contributor

ehuss commented Dec 31, 2024

Some drive-by questions:

  • I'm not clear which options to the attribute are being stabilized. The PR says "leak" and "address", but there doesn't appear to be a "leak" option. Is address the only attribute option being stabilized? If so, that needs to be documented. And this PR is referring to the thread option, which doesn't appear to be stabilized? If so, then it shouldn't include that.
  • Where can this attribute be placed? It seems to only validate its usage when there is an argument, which isn't how I would expect it to work.
  • What is the behavior if the attribute is specified multiple times? Does it take the union of all options?
  • I assume the attribute is ignored if the target does not support the sanitizer?
  • Does this only work with build-std or custom std builds?

@ehuss ehuss added S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. and removed S-waiting-on-review Status: The marked PR is awaiting review from a maintainer labels Jan 9, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jan 14, 2025

☔ The latest upstream changes (possibly f80986b) made this pull request unmergeable. Please resolve the merge conflicts.

@rcvalle
Copy link
Member Author

rcvalle commented Jan 24, 2025

Some drive-by questions:

  • I'm not clear which options to the attribute are being stabilized. The PR says "leak" and "address", but there doesn't appear to be a "leak" option. Is address the only attribute option being stabilized? If so, that needs to be documented. And this PR is referring to the thread option, which doesn't appear to be stabilized? If so, then it shouldn't include that.

Thanks for pointing it out! I copied the documentation from The Unstable Book and missed it. I'll fix it. (Yes, address is the only attribute being stabilized for now.)

  • Where can this attribute be placed? It seems to only validate its usage when there is an argument, which isn't how I would expect it to work.

It can be placed on globals and functions.

  • What is the behavior if the attribute is specified multiple times? Does it take the union of all options?

No, I believe it takes the last, but I'll double check.

  • I assume the attribute is ignored if the target does not support the sanitizer?

Yes.

* Does this only work with build-std or custom std builds?

No, it provides incremental value without requiring rebuilding the Rust Standard Library (i.e., Cargo build-std feature), and it's usually where it interests more the user (i.e., the code being developed). That said, we'll provide pre-build standard libraries for each sanitizer when stabilizing the MemorySanitizer and ThreadSanitizer next.

I've created a Zulip thread for us to discuss the next steps and stabilizing the no_sanitize attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. S-waiting-on-stabilization Waiting for a stabilization PR to be merged in the main Rust repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants