tokio-rs / loom

Concurrency permutation testing tool for Rust.
MIT License
2.13k stars 111 forks source link

Unclear "Concurrent write accesses" with UnsafeCell #278

Open kvark opened 2 years ago

kvark commented 2 years ago

---- util::loom stdout ---- thread 'util::loom' panicked at ' Causality violation: Concurrent write accesses to UnsafeCell. created: /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/ops/function.rs:150:5 write two: thread #1 @ src/util.rs:29:35 ', /Users/kvark/Code/loom/src/rt/location.rs:115:9 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

I'm confused about the error message. It says there are concurrent write accesses, so I would expect callstacks from 2 writes. Instead, it points to how the cell was created, and points to one of the writes. Where is the other one?

Repro by doing cargo test --features loom on https://github.com/kvark/choir/tree/loom-unsafecell-error