From 6c5c69fe44c32d5c69b7ad866aaebdd38cde0e54 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 8 Dec 2023 10:51:28 +0100 Subject: [PATCH] deliberate-ub: mention the load-load races in tokio --- resources/deliberate-ub.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/deliberate-ub.md b/resources/deliberate-ub.md index 1127bdca..7899786e 100644 --- a/resources/deliberate-ub.md +++ b/resources/deliberate-ub.md @@ -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).
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