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

deliberate-ub: mention the load-load races in tokio #481

Merged
merged 1 commit into from
Dec 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions resources/deliberate-ub.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ We should evaluate whether there truly is some use-case here that is not current
see the [discussion here](https://github.com/rust-lang/unsafe-code-guidelines/issues/449).<br>
The alternative is to not use the "fast path" for problematic types (and fall back to the SeqLock), but that requires some way to query at `const`-time whether the type contains padding (or provenance).
(Or of course one can use inline assembly, but it would be better if that was not required.)
* tokio causes race conditions between atomic and non-atomic loads which are [not permitted](https://doc.rust-lang.org/nightly/std/sync/atomic/index.html#memory-model-for-atomic-accesses);
see [this issue](https://github.com/tokio-rs/tokio/issues/6155) for details.

### Cases related to aliasing

Expand Down