Skip to content

Conversation

@luca3s
Copy link
Owner

@luca3s luca3s commented Jul 26, 2025

No description provided.

@luca3s
Copy link
Owner Author

luca3s commented Aug 13, 2025

I have reworked it a bit to remove "disable". I think i either addressed you comments or removed the text they were part of.

I hope you are fine with exposing the disable functions for now. This isn't going on stable rust, so they could be removed once the attribute exists.

from a function not sanitized. So a function could be both sanitized and not sanitized in one program execution.
The sanitizer can be disabled using the external function `__rtsan_disable()`. It can be enabled again using
`__rtsan_enable()`. Entering a real-time context while the sanitizer is enabled is not possible.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Entering a real-time context while the sanitizer is enabled is not possible.

I think you meant to say the opposite here but, regardless, I think it's possibly not worth including - IMHO it's more confusing than helpful for the average user who isn't aware of the sanitizer's inner workings. If you really feel it should be included, I'd suggest maybe something like Entering a real-time context while the sanitizer is disabled does not reactivate the sanitization.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah i thought about that too, will remove it.

Is there a open llvm/clang (or even in one of your repos) about it?
Just that it's written down at least somewhere.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the reminder! Yes - just added one

@davidtrevelyan
Copy link

I have reworked it a bit to remove "disable". I think i either addressed you comments or removed the text they were part of.

I hope you are fine with exposing the disable functions for now. This isn't going on stable rust, so they could be removed once the attribute exists.

Great - I think your changes are nice improvements! I've left a couple more minor comments but other than those it LGTM 👍

@luca3s luca3s force-pushed the docs-attr branch 2 times, most recently from 1cdd36f to 7ea4dc6 Compare August 19, 2025 13:06
@luca3s luca3s changed the base branch from sanitize-off-on to master August 19, 2025 13:06
luca3s pushed a commit that referenced this pull request Sep 14, 2025
…=jieyouxu

Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [#1 of Batch #2]

Part of rust-lang#133895

Methodology:

1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer

Inspired by the methodology that `@Kivooeo` was using.

r? `@jieyouxu`
luca3s pushed a commit that referenced this pull request Sep 14, 2025
…=jieyouxu

Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [#2 of Batch #2]

Part of rust-lang#133895

Methodology:

1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer

Inspired by the methodology that `@Kivooeo` was using.

r? `@jieyouxu`
luca3s pushed a commit that referenced this pull request Sep 14, 2025
…r=jieyouxu

Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [#3 of Batch #2]

Part of rust-lang#133895

Methodology:

1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer

Inspired by the methodology that `@Kivooeo` was using.

r? `@jieyouxu`
Copy link

@cjappl cjappl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems very close, left some suggestions on wording, ping me again and I'll review it ASAP

while in a real-time context, it reports an error.
Besides "nonblocking" the attribute can also be used with "blocking" and "caller".
- "blocking" marks the function as having a non-deterministic execution time. When reaching such
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly:

"blocking" allows programmers to mark a function as having non-deterministic execution time, but not necessarily calling a system call. When calling a "blocking" function in a real-time context, a violation will be reported. A classic use case of this is a userland spinlock.

(adding an example, indicating that it's a way to show intent of what the API does)

luca3s pushed a commit that referenced this pull request Oct 15, 2025
…r=jieyouxu

Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [rust-lang#4 of Batch #2]

Part of rust-lang#133895

Methodology:

1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer

Inspired by the methodology that `@Kivooeo` was using.

r? `@jieyouxu`
@luca3s luca3s requested a review from cjappl October 15, 2025 19:05
# RealtimeSanitizer
RealtimeSanitizer detects non-deterministic execution time calls in real-time contexts.
Function marked with the `#[sanitize(realtime = "nonblocking")]` attribute are considered real-time functions.
When RTSan detects a call to a function with non-deterministic execution time, like `malloc` or `free`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: it'd be good to hint at the fact that RTSan doesn't actually infer that a function has a non-deterministic execution time, it instead has a list of functions that it knows about in advance. I'd suggest something like:

"When RTSan detects a call to a known function considered to have non-deterministic execution time, like malloc..."

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know if that really makes sense. I think it kind of is a implementation detail and if it is in the clang docs.

I also couldn't think of a way to say this that i liked.

@luca3s luca3s force-pushed the docs-attr branch 2 times, most recently from 45be714 to 7450259 Compare October 20, 2025 21:26
luca3s pushed a commit that referenced this pull request Oct 20, 2025
…r=jieyouxu

Rehome 26 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [rust-lang#5 of Batch #2]

Part of rust-lang#133895

Methodology:

1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer

Inspired by the methodology that Kivooeo was using.

r? ```@jieyouxu```
@luca3s
Copy link
Owner Author

luca3s commented Oct 20, 2025

Sorry for all the rust commits that github shows here. If we continue to have discussions about the docs i would open a new PR.

@luca3s luca3s closed this Nov 8, 2025
@luca3s luca3s deleted the docs-attr branch November 9, 2025 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants