Hello, when I ran the sanitize example under crossbeam-epoch using Miri, I got an undefined behaviour error. As I am new to crossbeam, could you please offer some insight as to what could be the cause of the error? Thank you.
error: Undefined Behavior: Data race detected between (1) atomic load on thread `unnamed-4` and (2) retag read of type `std::sync::atomic::AtomicUsize` on thread `unnamed-5` at alloc1563563. (2) just happened here
--> /Users/lei.shi/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/boxed.rs:1008:9
|
1008 | Box(unsafe { Unique::new_unchecked(raw) }, alloc)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) atomic load on thread `unnamed-4` and (2) retag read of type `std::sync::atomic::AtomicUsize` on thread `unnamed-5` at alloc1563563. (2) just happened here
|
help: and (1) occurred earlier here
--> crossbeam-epoch/examples/sanitize.rs:30:21
|
30 | p.deref().load(Relaxed)
| ^^^^^^^^^^^^^^^^^^^^^^^
= help: overlapping atomic and non-atomic accesses must be synchronized, even if both are read-only
= help: see https://doc.rust-lang.org/nightly/std/sync/atomic/index.html#memory-model-for-atomic-accesses for more information about the Rust memory model
= help: retags occur on all (re)borrows and as well as when references are copied or moved
= help: retags permit optimizations that insert speculative reads or writes
= help: therefore from the perspective of data races, a retag has the same implications as a read or write
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
Hello, when I ran the sanitize example under
crossbeam-epoch
using Miri, I got an undefined behaviour error. As I am new to crossbeam, could you please offer some insight as to what could be the cause of the error? Thank you.The command I used,
and the error,
Environment,