22 ms·
Miri does catch a problem here: > error: Undefined Behavior: memory access failed: expected a pointer to 8 bytes of memory, but got 0x2f5f40[noalloc] which is
by empath75 2y ago
Miri does catch a problem here:
>
error: Undefined Behavior: memory access failed: expected a pointer to 8 bytes of memory, but got 0x2f5f40[noalloc] which is a dangling pointer (it has no provenance)
--> src/main.rs:263:33
|
263 | let next = unsafe { (*current.ptr).next };
| ^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 8 bytes of memory, but got 0x2f5f40[noalloc] which is a dangling pointer (it has no provenance)
|
= 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 https://doc.rust-lang.org/nightly/reference/behavior-conside... for further information
= note: BACKTRACE on thread `unnamed-2`:
= note: inside `LockFreeStack::pop` at src/main.rs:263:33: 263:52
- amluto 2y agoI think this is an unrelated problem: https://doc.rust-lang.org/std/ptr/index.html#provenance https://doc.rust-lang.org/std/ptr/index.html#provenance Fixing it cleanly seems like it might need a new AtomicPtrAndU64 or the ability to have an atomic 128-bit struct, and I have no idea whether the latter is even conceptually compatible with miri.