crossbeam-rs/crossbeam-epoch

Tsan reports data races on sanitize example

ordian opened this issue · 2 comments

Running

RUSTFLAGS="-Z sanitizer=thread" cargo +nightly run --example sanitize --target x86_64-unknown-linux-gnu

on current master (36f7a36) produces a lot of data race (in dealloc) warnings.
Same is true for running

RUSTFLAGS="-Z sanitizer=thread" cargo +nightly test --target x86_64-unknown-linux-gnu

on this example.

This is because the garbage collector uses fences to guarantee correctness, which the thread sanitizer doesn't understand. Quoting @stjepang:

Unfortunately, our code is full of fences, which thread sanitizer simply doesn't understand. I've noticed several false positives coming from thread sanitizer. The good news is that address sanitizer can still catch some errors due to bad memory orderings, incorrect epoch advancement, incorrect use of unprotected guards, etc.

Thanks! Closing the issue.