Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crossbeam-epoch: ThreadAnalyzer reports data race when using epoch::pin() #663

Closed
robinhundt opened this issue Feb 19, 2021 · 2 comments
Closed

Comments

@robinhundt
Copy link

I was playing around with epoch trying to implement a simple lock-free stack based on a singly-linked list. Running env RUSTFLAGS="-Z sanitizer=thread --cfg crossbeam_sanitize" cargo +nightly run --target x86_64-unknown-linux-gnu emitted warnings for a data race. Apparently not my code was the problem, but the calls to epoch::pin().
I was able to boil down the code to the following:

use crossbeam::{epoch};
use std::thread;

fn main() {
    let t1 = thread::spawn(|| {
        &epoch::pin();
    });

    let t2 = thread::spawn(|| {
        &epoch::pin();
    });

    t1.join();
    t2.join();
}
Output of `env RUSTFLAGS="-Z sanitizer=thread --cfg crossbeam_sanitize" cargo +nightly run --target x86_64-unknown-linux-gnu`
warning: unused `Result` that must be used
  --> src/main.rs:13:5
   |
13 |     t1.join();
   |     ^^^^^^^^^^
   |
   = note: `#[warn(unused_must_use)]` on by default
   = note: this `Result` may be an `Err` variant, which should be handled

warning: unused `Result` that must be used
  --> src/main.rs:14:5
   |
14 |     t2.join();
   |     ^^^^^^^^^^
   |
   = note: this `Result` may be an `Err` variant, which should be handled

warning: 2 warnings emitted

    Finished dev [unoptimized + debuginfo] target(s) in 0.02s
     Running `target/x86_64-unknown-linux-gnu/debug/epoch_pin_data_race`
==================
WARNING: ThreadSanitizer: data race (pid=220503)
  Read of size 8 at 0x561f96992150 by thread T2:
    #0 lazy_static::lazy::Lazy<T>::get /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/inline_lazy.rs:38 (epoch_pin_data_race+0x90796)
    #1 <crossbeam_epoch::default::COLLECTOR as core::ops::deref::Deref>::deref::__stability /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/lib.rs:142 (epoch_pin_data_race+0x90796)
    #2 <crossbeam_epoch::default::COLLECTOR as core::ops::deref::Deref>::deref /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/lib.rs:144 (epoch_pin_data_race+0x90796)
    #3 crossbeam_epoch::default::HANDLE::__init /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:18 (epoch_pin_data_race+0x9064d)
    #4 core::ops::function::FnOnce::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x99e02)
    #5 std::thread::local::lazy::LazyKeyInner<T>::initialize /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:304 (epoch_pin_data_race+0x98ba9)
    #6 std::thread::local::fast::Key<T>::try_initialize /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:473 (epoch_pin_data_race+0x90aec)
    #7 std::thread::local::fast::Key<T>::get /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:456 (epoch_pin_data_race+0x90cbf)
    #8 crossbeam_epoch::default::HANDLE::__getit /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:183 (epoch_pin_data_race+0x906c9)
    #9 std::thread::local::LocalKey<T>::try_with /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:271 (epoch_pin_data_race+0x83e4c)
    #10 crossbeam_epoch::default::with_handle /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:43 (epoch_pin_data_race+0x838b8)
    #11 crossbeam_epoch::default::pin /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:24 (epoch_pin_data_race+0x814e2)
    #12 epoch_pin_data_race::main::{{closure}} /home/robin/code/epoch_pin_data_race/src/main.rs:10 (epoch_pin_data_race+0x859f2)
    #13 std::sys_common::backtrace::__rust_begin_short_backtrace /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125 (epoch_pin_data_race+0x81a22)
    #14 std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:474 (epoch_pin_data_race+0x7f7c2)
    #15 <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:344 (epoch_pin_data_race+0x853c2)
    #16 std::panicking::try::do_call /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:379 (epoch_pin_data_race+0x84254)
    #17 __rust_try 4qd62slf5wbr3hua:? (epoch_pin_data_race+0x8457b)
    #18 std::panicking::try /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:343 (epoch_pin_data_race+0x84163)
    #19 std::panic::catch_unwind /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:431 (epoch_pin_data_race+0x85452)
    #20 std::thread::Builder::spawn_unchecked::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:473 (epoch_pin_data_race+0x7f24c)
    #21 core::ops::function::FnOnce::call_once{{vtable.shim}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x7fe57)
    #22 <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/alloc/src/boxed.rs:1546 (epoch_pin_data_race+0xbe829)
    #23 <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/alloc/src/boxed.rs:1546 (epoch_pin_data_race+0xbe829)
    #24 std::sys::unix::thread::Thread::new::thread_start /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/thread.rs:71 (epoch_pin_data_race+0xbe829)

  Previous write of size 8 at 0x561f96992150 by thread T1:
    #0 memcpy /rustc/llvm/src/llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_common_interceptors.inc:808 (epoch_pin_data_race+0x1b957)
    #1 core::ptr::swap_nonoverlapping_one /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:459 (epoch_pin_data_race+0x8c1d7)
    #2 core::mem::swap /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs:700 (epoch_pin_data_race+0x8e04d)
    #3 core::mem::replace /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs:827 (epoch_pin_data_race+0x8e621)
    #4 core::cell::Cell<T>::replace /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/cell.rs:397 (epoch_pin_data_race+0x9b177)
    #5 core::cell::Cell<T>::set /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/cell.rs:348 (epoch_pin_data_race+0x9aeed)
    #6 lazy_static::lazy::Lazy<T>::get::{{closure}} /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/inline_lazy.rs:31 (epoch_pin_data_race+0x90273)
    #7 std::sync::once::Once::call_once::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sync/once.rs:261 (epoch_pin_data_race+0x90a2c)
    #8 std::sync::once::Once::call_inner /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sync/once.rs:418 (epoch_pin_data_race+0xb9be1)
    #9 lazy_static::lazy::Lazy<T>::get /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/inline_lazy.rs:30 (epoch_pin_data_race+0x9076b)
    #10 <crossbeam_epoch::default::COLLECTOR as core::ops::deref::Deref>::deref::__stability /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/lib.rs:142 (epoch_pin_data_race+0x9076b)
    #11 <crossbeam_epoch::default::COLLECTOR as core::ops::deref::Deref>::deref /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/lib.rs:144 (epoch_pin_data_race+0x9076b)
    #12 crossbeam_epoch::default::HANDLE::__init /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:18 (epoch_pin_data_race+0x9064d)
    #13 core::ops::function::FnOnce::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x99e02)
    #14 std::thread::local::lazy::LazyKeyInner<T>::initialize /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:304 (epoch_pin_data_race+0x98ba9)
    #15 std::thread::local::fast::Key<T>::try_initialize /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:473 (epoch_pin_data_race+0x90aec)
    #16 std::thread::local::fast::Key<T>::get /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:456 (epoch_pin_data_race+0x90cbf)
    #17 crossbeam_epoch::default::HANDLE::__getit /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:183 (epoch_pin_data_race+0x906c9)
    #18 std::thread::local::LocalKey<T>::try_with /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:271 (epoch_pin_data_race+0x83e4c)
    #19 crossbeam_epoch::default::with_handle /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:43 (epoch_pin_data_race+0x838b8)
    #20 crossbeam_epoch::default::pin /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:24 (epoch_pin_data_race+0x814e2)
    #21 epoch_pin_data_race::main::{{closure}} /home/robin/code/epoch_pin_data_race/src/main.rs:6 (epoch_pin_data_race+0x85982)
    #22 std::sys_common::backtrace::__rust_begin_short_backtrace /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125 (epoch_pin_data_race+0x81aa2)
    #23 std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:474 (epoch_pin_data_race+0x7f802)
    #24 <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:344 (epoch_pin_data_race+0x85382)
    #25 std::panicking::try::do_call /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:379 (epoch_pin_data_race+0x842c4)
    #26 __rust_try 4qd62slf5wbr3hua:? (epoch_pin_data_race+0x8457b)
    #27 std::panicking::try /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:343 (epoch_pin_data_race+0x84083)
    #28 std::panic::catch_unwind /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:431 (epoch_pin_data_race+0x85402)
    #29 std::thread::Builder::spawn_unchecked::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:473 (epoch_pin_data_race+0x7f5bc)
    #30 core::ops::function::FnOnce::call_once{{vtable.shim}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x7fe07)
    #31 <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/alloc/src/boxed.rs:1546 (epoch_pin_data_race+0xbe829)
    #32 <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/alloc/src/boxed.rs:1546 (epoch_pin_data_race+0xbe829)
    #33 std::sys::unix::thread::Thread::new::thread_start /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/thread.rs:71 (epoch_pin_data_race+0xbe829)

  Location is global '<null>' at 0x000000000000 (epoch_pin_data_race+0x000000b42150)

  Thread T2 (tid=220509, running) created by main thread at:
    #0 pthread_create /rustc/llvm/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:966 (epoch_pin_data_race+0x11c6b)
    #1 std::sys::unix::thread::Thread::new /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/thread.rs:50 (epoch_pin_data_race+0xbe541)
    #2 std::thread::Builder::spawn /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:381 (epoch_pin_data_race+0x7f902)
    #3 std::thread::spawn /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:620 (epoch_pin_data_race+0x7de61)
    #4 epoch_pin_data_race::main /home/robin/code/epoch_pin_data_race/src/main.rs:9 (epoch_pin_data_race+0x82f46)
    #5 core::ops::function::FnOnce::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x7fea1)
    #6 std::sys_common::backtrace::__rust_begin_short_backtrace /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125 (epoch_pin_data_race+0x81b37)
    #7 std::rt::lang_start::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:66 (epoch_pin_data_race+0x86104)
    #8 core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/core/src/ops/function.rs:259 (epoch_pin_data_race+0xbc946)
    #9 std::panicking::try::do_call /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panicking.rs:379 (epoch_pin_data_race+0xbc946)
    #10 std::panicking::try /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panicking.rs:343 (epoch_pin_data_race+0xbc946)
    #11 std::panic::catch_unwind /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panic.rs:431 (epoch_pin_data_race+0xbc946)
    #12 std::rt::lang_start_internal /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/rt.rs:51 (epoch_pin_data_race+0xbc946)
    #13 main ??:? (epoch_pin_data_race+0x8315a)

  Thread T1 (tid=220508, finished) created by main thread at:
    #0 pthread_create /rustc/llvm/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:966 (epoch_pin_data_race+0x11c6b)
    #1 std::sys::unix::thread::Thread::new /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/thread.rs:50 (epoch_pin_data_race+0xbe541)
    #2 std::thread::Builder::spawn /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:381 (epoch_pin_data_race+0x7f882)
    #3 std::thread::spawn /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:620 (epoch_pin_data_race+0x7dda1)
    #4 epoch_pin_data_race::main /home/robin/code/epoch_pin_data_race/src/main.rs:5 (epoch_pin_data_race+0x82f35)
    #5 core::ops::function::FnOnce::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x7fea1)
    #6 std::sys_common::backtrace::__rust_begin_short_backtrace /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125 (epoch_pin_data_race+0x81b37)
    #7 std::rt::lang_start::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:66 (epoch_pin_data_race+0x86104)
    #8 core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/core/src/ops/function.rs:259 (epoch_pin_data_race+0xbc946)
    #9 std::panicking::try::do_call /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panicking.rs:379 (epoch_pin_data_race+0xbc946)
    #10 std::panicking::try /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panicking.rs:343 (epoch_pin_data_race+0xbc946)
    #11 std::panic::catch_unwind /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panic.rs:431 (epoch_pin_data_race+0xbc946)
    #12 std::rt::lang_start_internal /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/rt.rs:51 (epoch_pin_data_race+0xbc946)
    #13 main ??:? (epoch_pin_data_race+0x8315a)

SUMMARY: ThreadSanitizer: data race /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/inline_lazy.rs:38 in lazy_static::lazy::Lazy<T>::get
==================
==================
WARNING: ThreadSanitizer: data race (pid=220503)
  Atomic write of size 8 at 0x7b5400000000 by thread T2:
    #0 __tsan_atomic64_fetch_add /rustc/llvm/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interface_atomic.cpp:620 (epoch_pin_data_race+0x53cb5)
    #1 core::sync::atomic::atomic_add /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:2386 (epoch_pin_data_race+0xa16dc)
    #2 core::sync::atomic::AtomicUsize::fetch_add /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:1739 (epoch_pin_data_race+0x8f479)
    #3 <alloc::sync::Arc<T> as core::clone::Clone>::clone /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:1279 (epoch_pin_data_race+0x9150d)
    #4 <crossbeam_epoch::collector::Collector as core::clone::Clone>::clone /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/collector.rs:53 (epoch_pin_data_race+0x9944b)
    #5 crossbeam_epoch::internal::Local::register /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/internal.rs:395 (epoch_pin_data_race+0x88da2)
    #6 crossbeam_epoch::collector::Collector::register /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/collector.rs:45 (epoch_pin_data_race+0x993e7)
    #7 crossbeam_epoch::default::HANDLE::__init /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:18 (epoch_pin_data_race+0x90664)
    #8 core::ops::function::FnOnce::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x99e02)
    #9 std::thread::local::lazy::LazyKeyInner<T>::initialize /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:304 (epoch_pin_data_race+0x98ba9)
    #10 std::thread::local::fast::Key<T>::try_initialize /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:473 (epoch_pin_data_race+0x90aec)
    #11 std::thread::local::fast::Key<T>::get /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:456 (epoch_pin_data_race+0x90cbf)
    #12 crossbeam_epoch::default::HANDLE::__getit /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:183 (epoch_pin_data_race+0x906c9)
    #13 std::thread::local::LocalKey<T>::try_with /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:271 (epoch_pin_data_race+0x83e4c)
    #14 crossbeam_epoch::default::with_handle /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:43 (epoch_pin_data_race+0x838b8)
    #15 crossbeam_epoch::default::pin /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:24 (epoch_pin_data_race+0x814e2)
    #16 epoch_pin_data_race::main::{{closure}} /home/robin/code/epoch_pin_data_race/src/main.rs:10 (epoch_pin_data_race+0x859f2)
    #17 std::sys_common::backtrace::__rust_begin_short_backtrace /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125 (epoch_pin_data_race+0x81a22)
    #18 std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:474 (epoch_pin_data_race+0x7f7c2)
    #19 <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:344 (epoch_pin_data_race+0x853c2)
    #20 std::panicking::try::do_call /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:379 (epoch_pin_data_race+0x84254)
    #21 __rust_try 4qd62slf5wbr3hua:? (epoch_pin_data_race+0x8457b)
    #22 std::panicking::try /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:343 (epoch_pin_data_race+0x84163)
    #23 std::panic::catch_unwind /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:431 (epoch_pin_data_race+0x85452)
    #24 std::thread::Builder::spawn_unchecked::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:473 (epoch_pin_data_race+0x7f24c)
    #25 core::ops::function::FnOnce::call_once{{vtable.shim}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x7fe57)
    #26 <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/alloc/src/boxed.rs:1546 (epoch_pin_data_race+0xbe829)
    #27 <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/alloc/src/boxed.rs:1546 (epoch_pin_data_race+0xbe829)
    #28 std::sys::unix::thread::Thread::new::thread_start /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/thread.rs:71 (epoch_pin_data_race+0xbe829)

  Previous write of size 8 at 0x7b5400000000 by thread T1:
    #0 posix_memalign /rustc/llvm/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:836 (epoch_pin_data_race+0x11a31)
    #1 std::sys::unix::alloc::aligned_malloc /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/alloc.rs:95 (epoch_pin_data_race+0xbb34c)
    #2 std::sys::unix::alloc::<impl core::alloc::global::GlobalAlloc for std::alloc::System>::alloc /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/alloc.rs:22 (epoch_pin_data_race+0xbb34c)
    #3 __rdl_alloc /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/alloc.rs:357 (epoch_pin_data_race+0xbb34c)
    #4 alloc::alloc::Global::alloc_impl /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:166 (epoch_pin_data_race+0x97f57)
    #5 <alloc::alloc::Global as core::alloc::Allocator>::allocate /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:226 (epoch_pin_data_race+0x98b1e)
    #6 alloc::alloc::exchange_malloc /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:316 (epoch_pin_data_race+0x97cb5)
    #7 alloc::sync::Arc<T>::new /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:332 (epoch_pin_data_race+0x91041)
    #8 <crossbeam_epoch::collector::Collector as core::default::Default>::default /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/collector.rs:32 (epoch_pin_data_race+0x99319)
    #9 crossbeam_epoch::collector::Collector::new /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/collector.rs:40 (epoch_pin_data_race+0x99386)
    #10 <crossbeam_epoch::default::COLLECTOR as core::ops::deref::Deref>::deref::__static_ref_initialize /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:13 (epoch_pin_data_race+0x99db6)
    #11 core::ops::function::FnOnce::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x99db6)
    #12 lazy_static::lazy::Lazy<T>::get::{{closure}} /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/inline_lazy.rs:31 (epoch_pin_data_race+0x9024d)
    #13 std::sync::once::Once::call_once::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sync/once.rs:261 (epoch_pin_data_race+0x90a2c)
    #14 std::sync::once::Once::call_inner /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sync/once.rs:418 (epoch_pin_data_race+0xb9be1)
    #15 lazy_static::lazy::Lazy<T>::get /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/inline_lazy.rs:30 (epoch_pin_data_race+0x9076b)
    #16 <crossbeam_epoch::default::COLLECTOR as core::ops::deref::Deref>::deref::__stability /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/lib.rs:142 (epoch_pin_data_race+0x9076b)
    #17 <crossbeam_epoch::default::COLLECTOR as core::ops::deref::Deref>::deref /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/lib.rs:144 (epoch_pin_data_race+0x9076b)
    #18 crossbeam_epoch::default::HANDLE::__init /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:18 (epoch_pin_data_race+0x9064d)
    #19 core::ops::function::FnOnce::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x99e02)
    #20 std::thread::local::lazy::LazyKeyInner<T>::initialize /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:304 (epoch_pin_data_race+0x98ba9)
    #21 std::thread::local::fast::Key<T>::try_initialize /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:473 (epoch_pin_data_race+0x90aec)
    #22 std::thread::local::fast::Key<T>::get /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:456 (epoch_pin_data_race+0x90cbf)
    #23 crossbeam_epoch::default::HANDLE::__getit /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:183 (epoch_pin_data_race+0x906c9)
    #24 std::thread::local::LocalKey<T>::try_with /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:271 (epoch_pin_data_race+0x83e4c)
    #25 crossbeam_epoch::default::with_handle /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:43 (epoch_pin_data_race+0x838b8)
    #26 crossbeam_epoch::default::pin /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:24 (epoch_pin_data_race+0x814e2)
    #27 epoch_pin_data_race::main::{{closure}} /home/robin/code/epoch_pin_data_race/src/main.rs:6 (epoch_pin_data_race+0x85982)
    #28 std::sys_common::backtrace::__rust_begin_short_backtrace /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125 (epoch_pin_data_race+0x81aa2)
    #29 std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:474 (epoch_pin_data_race+0x7f802)
    #30 <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:344 (epoch_pin_data_race+0x85382)
    #31 std::panicking::try::do_call /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:379 (epoch_pin_data_race+0x842c4)
    #32 __rust_try 4qd62slf5wbr3hua:? (epoch_pin_data_race+0x8457b)
    #33 std::panicking::try /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:343 (epoch_pin_data_race+0x84083)
    #34 std::panic::catch_unwind /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:431 (epoch_pin_data_race+0x85402)
    #35 std::thread::Builder::spawn_unchecked::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:473 (epoch_pin_data_race+0x7f5bc)
    #36 core::ops::function::FnOnce::call_once{{vtable.shim}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x7fe07)
    #37 <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/alloc/src/boxed.rs:1546 (epoch_pin_data_race+0xbe829)
    #38 <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/alloc/src/boxed.rs:1546 (epoch_pin_data_race+0xbe829)
    #39 std::sys::unix::thread::Thread::new::thread_start /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/thread.rs:71 (epoch_pin_data_race+0xbe829)

  Location is heap block of size 640 at 0x7b5400000000 allocated by thread T1:
    #0 posix_memalign /rustc/llvm/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:836 (epoch_pin_data_race+0x11a31)
    #1 std::sys::unix::alloc::aligned_malloc /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/alloc.rs:95 (epoch_pin_data_race+0xbb34c)
    #2 std::sys::unix::alloc::<impl core::alloc::global::GlobalAlloc for std::alloc::System>::alloc /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/alloc.rs:22 (epoch_pin_data_race+0xbb34c)
    #3 __rdl_alloc /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/alloc.rs:357 (epoch_pin_data_race+0xbb34c)
    #4 alloc::alloc::Global::alloc_impl /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:166 (epoch_pin_data_race+0x97f57)
    #5 <alloc::alloc::Global as core::alloc::Allocator>::allocate /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:226 (epoch_pin_data_race+0x98b1e)
    #6 alloc::alloc::exchange_malloc /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:316 (epoch_pin_data_race+0x97cb5)
    #7 alloc::sync::Arc<T>::new /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:332 (epoch_pin_data_race+0x91041)
    #8 <crossbeam_epoch::collector::Collector as core::default::Default>::default /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/collector.rs:32 (epoch_pin_data_race+0x99319)
    #9 crossbeam_epoch::collector::Collector::new /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/collector.rs:40 (epoch_pin_data_race+0x99386)
    #10 <crossbeam_epoch::default::COLLECTOR as core::ops::deref::Deref>::deref::__static_ref_initialize /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:13 (epoch_pin_data_race+0x99db6)
    #11 core::ops::function::FnOnce::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x99db6)
    #12 lazy_static::lazy::Lazy<T>::get::{{closure}} /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/inline_lazy.rs:31 (epoch_pin_data_race+0x9024d)
    #13 std::sync::once::Once::call_once::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sync/once.rs:261 (epoch_pin_data_race+0x90a2c)
    #14 std::sync::once::Once::call_inner /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sync/once.rs:418 (epoch_pin_data_race+0xb9be1)
    #15 lazy_static::lazy::Lazy<T>::get /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/inline_lazy.rs:30 (epoch_pin_data_race+0x9076b)
    #16 <crossbeam_epoch::default::COLLECTOR as core::ops::deref::Deref>::deref::__stability /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/lib.rs:142 (epoch_pin_data_race+0x9076b)
    #17 <crossbeam_epoch::default::COLLECTOR as core::ops::deref::Deref>::deref /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/lib.rs:144 (epoch_pin_data_race+0x9076b)
    #18 crossbeam_epoch::default::HANDLE::__init /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:18 (epoch_pin_data_race+0x9064d)
    #19 core::ops::function::FnOnce::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x99e02)
    #20 std::thread::local::lazy::LazyKeyInner<T>::initialize /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:304 (epoch_pin_data_race+0x98ba9)
    #21 std::thread::local::fast::Key<T>::try_initialize /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:473 (epoch_pin_data_race+0x90aec)
    #22 std::thread::local::fast::Key<T>::get /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:456 (epoch_pin_data_race+0x90cbf)
    #23 crossbeam_epoch::default::HANDLE::__getit /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:183 (epoch_pin_data_race+0x906c9)
    #24 std::thread::local::LocalKey<T>::try_with /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:271 (epoch_pin_data_race+0x83e4c)
    #25 crossbeam_epoch::default::with_handle /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:43 (epoch_pin_data_race+0x838b8)
    #26 crossbeam_epoch::default::pin /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:24 (epoch_pin_data_race+0x814e2)
    #27 epoch_pin_data_race::main::{{closure}} /home/robin/code/epoch_pin_data_race/src/main.rs:6 (epoch_pin_data_race+0x85982)
    #28 std::sys_common::backtrace::__rust_begin_short_backtrace /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125 (epoch_pin_data_race+0x81aa2)
    #29 std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:474 (epoch_pin_data_race+0x7f802)
    #30 <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:344 (epoch_pin_data_race+0x85382)
    #31 std::panicking::try::do_call /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:379 (epoch_pin_data_race+0x842c4)
    #32 __rust_try 4qd62slf5wbr3hua:? (epoch_pin_data_race+0x8457b)
    #33 std::panicking::try /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:343 (epoch_pin_data_race+0x84083)
    #34 std::panic::catch_unwind /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:431 (epoch_pin_data_race+0x85402)
    #35 std::thread::Builder::spawn_unchecked::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:473 (epoch_pin_data_race+0x7f5bc)
    #36 core::ops::function::FnOnce::call_once{{vtable.shim}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x7fe07)
    #37 <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/alloc/src/boxed.rs:1546 (epoch_pin_data_race+0xbe829)
    #38 <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/alloc/src/boxed.rs:1546 (epoch_pin_data_race+0xbe829)
    #39 std::sys::unix::thread::Thread::new::thread_start /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/thread.rs:71 (epoch_pin_data_race+0xbe829)

  Thread T2 (tid=220509, running) created by main thread at:
    #0 pthread_create /rustc/llvm/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:966 (epoch_pin_data_race+0x11c6b)
    #1 std::sys::unix::thread::Thread::new /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/thread.rs:50 (epoch_pin_data_race+0xbe541)
    #2 std::thread::Builder::spawn /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:381 (epoch_pin_data_race+0x7f902)
    #3 std::thread::spawn /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:620 (epoch_pin_data_race+0x7de61)
    #4 epoch_pin_data_race::main /home/robin/code/epoch_pin_data_race/src/main.rs:9 (epoch_pin_data_race+0x82f46)
    #5 core::ops::function::FnOnce::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x7fea1)
    #6 std::sys_common::backtrace::__rust_begin_short_backtrace /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125 (epoch_pin_data_race+0x81b37)
    #7 std::rt::lang_start::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:66 (epoch_pin_data_race+0x86104)
    #8 core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/core/src/ops/function.rs:259 (epoch_pin_data_race+0xbc946)
    #9 std::panicking::try::do_call /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panicking.rs:379 (epoch_pin_data_race+0xbc946)
    #10 std::panicking::try /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panicking.rs:343 (epoch_pin_data_race+0xbc946)
    #11 std::panic::catch_unwind /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panic.rs:431 (epoch_pin_data_race+0xbc946)
    #12 std::rt::lang_start_internal /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/rt.rs:51 (epoch_pin_data_race+0xbc946)
    #13 main ??:? (epoch_pin_data_race+0x8315a)

  Thread T1 (tid=220508, finished) created by main thread at:
    #0 pthread_create /rustc/llvm/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:966 (epoch_pin_data_race+0x11c6b)
    #1 std::sys::unix::thread::Thread::new /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/thread.rs:50 (epoch_pin_data_race+0xbe541)
    #2 std::thread::Builder::spawn /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:381 (epoch_pin_data_race+0x7f882)
    #3 std::thread::spawn /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:620 (epoch_pin_data_race+0x7dda1)
    #4 epoch_pin_data_race::main /home/robin/code/epoch_pin_data_race/src/main.rs:5 (epoch_pin_data_race+0x82f35)
    #5 core::ops::function::FnOnce::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x7fea1)
    #6 std::sys_common::backtrace::__rust_begin_short_backtrace /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125 (epoch_pin_data_race+0x81b37)
    #7 std::rt::lang_start::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:66 (epoch_pin_data_race+0x86104)
    #8 core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/core/src/ops/function.rs:259 (epoch_pin_data_race+0xbc946)
    #9 std::panicking::try::do_call /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panicking.rs:379 (epoch_pin_data_race+0xbc946)
    #10 std::panicking::try /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panicking.rs:343 (epoch_pin_data_race+0xbc946)
    #11 std::panic::catch_unwind /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panic.rs:431 (epoch_pin_data_race+0xbc946)
    #12 std::rt::lang_start_internal /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/rt.rs:51 (epoch_pin_data_race+0xbc946)
    #13 main ??:? (epoch_pin_data_race+0x8315a)

SUMMARY: ThreadSanitizer: data race /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:2386 in core::sync::atomic::atomic_add
==================
==================
WARNING: ThreadSanitizer: data race (pid=220503)
  Atomic read of size 8 at 0x7b5400000200 by thread T2:
    #0 __tsan_atomic64_load /rustc/llvm/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interface_atomic.cpp:539 (epoch_pin_data_race+0x538ce)
    #1 core::sync::atomic::atomic_load /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:2353 (epoch_pin_data_race+0xa1939)
    #2 core::sync::atomic::AtomicUsize::load /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:1491 (epoch_pin_data_race+0x8f296)
    #3 crossbeam_epoch::atomic::Atomic<T>::load /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/atomic.rs:354 (epoch_pin_data_race+0x92cf6)
    #4 crossbeam_epoch::sync::list::List<T,C>::insert /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/sync/list.rs:180 (epoch_pin_data_race+0x96453)
    #5 crossbeam_epoch::internal::Local::register /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/internal.rs:402 (epoch_pin_data_race+0x89044)
    #6 crossbeam_epoch::collector::Collector::register /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/collector.rs:45 (epoch_pin_data_race+0x993e7)
    #7 crossbeam_epoch::default::HANDLE::__init /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:18 (epoch_pin_data_race+0x90664)
    #8 core::ops::function::FnOnce::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x99e02)
    #9 std::thread::local::lazy::LazyKeyInner<T>::initialize /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:304 (epoch_pin_data_race+0x98ba9)
    #10 std::thread::local::fast::Key<T>::try_initialize /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:473 (epoch_pin_data_race+0x90aec)
    #11 std::thread::local::fast::Key<T>::get /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:456 (epoch_pin_data_race+0x90cbf)
    #12 crossbeam_epoch::default::HANDLE::__getit /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:183 (epoch_pin_data_race+0x906c9)
    #13 std::thread::local::LocalKey<T>::try_with /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:271 (epoch_pin_data_race+0x83e4c)
    #14 crossbeam_epoch::default::with_handle /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:43 (epoch_pin_data_race+0x838b8)
    #15 crossbeam_epoch::default::pin /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:24 (epoch_pin_data_race+0x814e2)
    #16 epoch_pin_data_race::main::{{closure}} /home/robin/code/epoch_pin_data_race/src/main.rs:10 (epoch_pin_data_race+0x859f2)
    #17 std::sys_common::backtrace::__rust_begin_short_backtrace /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125 (epoch_pin_data_race+0x81a22)
    #18 std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:474 (epoch_pin_data_race+0x7f7c2)
    #19 <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:344 (epoch_pin_data_race+0x853c2)
    #20 std::panicking::try::do_call /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:379 (epoch_pin_data_race+0x84254)
    #21 __rust_try 4qd62slf5wbr3hua:? (epoch_pin_data_race+0x8457b)
    #22 std::panicking::try /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:343 (epoch_pin_data_race+0x84163)
    #23 std::panic::catch_unwind /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:431 (epoch_pin_data_race+0x85452)
    #24 std::thread::Builder::spawn_unchecked::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:473 (epoch_pin_data_race+0x7f24c)
    #25 core::ops::function::FnOnce::call_once{{vtable.shim}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x7fe57)
    #26 <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/alloc/src/boxed.rs:1546 (epoch_pin_data_race+0xbe829)
    #27 <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/alloc/src/boxed.rs:1546 (epoch_pin_data_race+0xbe829)
    #28 std::sys::unix::thread::Thread::new::thread_start /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/thread.rs:71 (epoch_pin_data_race+0xbe829)

  Previous write of size 8 at 0x7b5400000200 by thread T1:
    #0 posix_memalign /rustc/llvm/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:836 (epoch_pin_data_race+0x11a31)
    #1 std::sys::unix::alloc::aligned_malloc /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/alloc.rs:95 (epoch_pin_data_race+0xbb34c)
    #2 std::sys::unix::alloc::<impl core::alloc::global::GlobalAlloc for std::alloc::System>::alloc /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/alloc.rs:22 (epoch_pin_data_race+0xbb34c)
    #3 __rdl_alloc /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/alloc.rs:357 (epoch_pin_data_race+0xbb34c)
    #4 alloc::alloc::Global::alloc_impl /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:166 (epoch_pin_data_race+0x97f57)
    #5 <alloc::alloc::Global as core::alloc::Allocator>::allocate /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:226 (epoch_pin_data_race+0x98b1e)
    #6 alloc::alloc::exchange_malloc /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:316 (epoch_pin_data_race+0x97cb5)
    #7 alloc::sync::Arc<T>::new /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:332 (epoch_pin_data_race+0x91041)
    #8 <crossbeam_epoch::collector::Collector as core::default::Default>::default /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/collector.rs:32 (epoch_pin_data_race+0x99319)
    #9 crossbeam_epoch::collector::Collector::new /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/collector.rs:40 (epoch_pin_data_race+0x99386)
    #10 <crossbeam_epoch::default::COLLECTOR as core::ops::deref::Deref>::deref::__static_ref_initialize /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:13 (epoch_pin_data_race+0x99db6)
    #11 core::ops::function::FnOnce::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x99db6)
    #12 lazy_static::lazy::Lazy<T>::get::{{closure}} /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/inline_lazy.rs:31 (epoch_pin_data_race+0x9024d)
    #13 std::sync::once::Once::call_once::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sync/once.rs:261 (epoch_pin_data_race+0x90a2c)
    #14 std::sync::once::Once::call_inner /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sync/once.rs:418 (epoch_pin_data_race+0xb9be1)
    #15 lazy_static::lazy::Lazy<T>::get /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/inline_lazy.rs:30 (epoch_pin_data_race+0x9076b)
    #16 <crossbeam_epoch::default::COLLECTOR as core::ops::deref::Deref>::deref::__stability /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/lib.rs:142 (epoch_pin_data_race+0x9076b)
    #17 <crossbeam_epoch::default::COLLECTOR as core::ops::deref::Deref>::deref /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/lib.rs:144 (epoch_pin_data_race+0x9076b)
    #18 crossbeam_epoch::default::HANDLE::__init /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:18 (epoch_pin_data_race+0x9064d)
    #19 core::ops::function::FnOnce::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x99e02)
    #20 std::thread::local::lazy::LazyKeyInner<T>::initialize /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:304 (epoch_pin_data_race+0x98ba9)
    #21 std::thread::local::fast::Key<T>::try_initialize /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:473 (epoch_pin_data_race+0x90aec)
    #22 std::thread::local::fast::Key<T>::get /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:456 (epoch_pin_data_race+0x90cbf)
    #23 crossbeam_epoch::default::HANDLE::__getit /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:183 (epoch_pin_data_race+0x906c9)
    #24 std::thread::local::LocalKey<T>::try_with /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:271 (epoch_pin_data_race+0x83e4c)
    #25 crossbeam_epoch::default::with_handle /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:43 (epoch_pin_data_race+0x838b8)
    #26 crossbeam_epoch::default::pin /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:24 (epoch_pin_data_race+0x814e2)
    #27 epoch_pin_data_race::main::{{closure}} /home/robin/code/epoch_pin_data_race/src/main.rs:6 (epoch_pin_data_race+0x85982)
    #28 std::sys_common::backtrace::__rust_begin_short_backtrace /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125 (epoch_pin_data_race+0x81aa2)
    #29 std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:474 (epoch_pin_data_race+0x7f802)
    #30 <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:344 (epoch_pin_data_race+0x85382)
    #31 std::panicking::try::do_call /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:379 (epoch_pin_data_race+0x842c4)
    #32 __rust_try 4qd62slf5wbr3hua:? (epoch_pin_data_race+0x8457b)
    #33 std::panicking::try /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:343 (epoch_pin_data_race+0x84083)
    #34 std::panic::catch_unwind /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:431 (epoch_pin_data_race+0x85402)
    #35 std::thread::Builder::spawn_unchecked::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:473 (epoch_pin_data_race+0x7f5bc)
    #36 core::ops::function::FnOnce::call_once{{vtable.shim}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x7fe07)
    #37 <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/alloc/src/boxed.rs:1546 (epoch_pin_data_race+0xbe829)
    #38 <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/alloc/src/boxed.rs:1546 (epoch_pin_data_race+0xbe829)
    #39 std::sys::unix::thread::Thread::new::thread_start /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/thread.rs:71 (epoch_pin_data_race+0xbe829)

  Location is heap block of size 640 at 0x7b5400000000 allocated by thread T1:
    #0 posix_memalign /rustc/llvm/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:836 (epoch_pin_data_race+0x11a31)
    #1 std::sys::unix::alloc::aligned_malloc /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/alloc.rs:95 (epoch_pin_data_race+0xbb34c)
    #2 std::sys::unix::alloc::<impl core::alloc::global::GlobalAlloc for std::alloc::System>::alloc /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/alloc.rs:22 (epoch_pin_data_race+0xbb34c)
    #3 __rdl_alloc /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/alloc.rs:357 (epoch_pin_data_race+0xbb34c)
    #4 alloc::alloc::Global::alloc_impl /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:166 (epoch_pin_data_race+0x97f57)
    #5 <alloc::alloc::Global as core::alloc::Allocator>::allocate /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:226 (epoch_pin_data_race+0x98b1e)
    #6 alloc::alloc::exchange_malloc /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:316 (epoch_pin_data_race+0x97cb5)
    #7 alloc::sync::Arc<T>::new /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:332 (epoch_pin_data_race+0x91041)
    #8 <crossbeam_epoch::collector::Collector as core::default::Default>::default /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/collector.rs:32 (epoch_pin_data_race+0x99319)
    #9 crossbeam_epoch::collector::Collector::new /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/collector.rs:40 (epoch_pin_data_race+0x99386)
    #10 <crossbeam_epoch::default::COLLECTOR as core::ops::deref::Deref>::deref::__static_ref_initialize /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:13 (epoch_pin_data_race+0x99db6)
    #11 core::ops::function::FnOnce::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x99db6)
    #12 lazy_static::lazy::Lazy<T>::get::{{closure}} /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/inline_lazy.rs:31 (epoch_pin_data_race+0x9024d)
    #13 std::sync::once::Once::call_once::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sync/once.rs:261 (epoch_pin_data_race+0x90a2c)
    #14 std::sync::once::Once::call_inner /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sync/once.rs:418 (epoch_pin_data_race+0xb9be1)
    #15 lazy_static::lazy::Lazy<T>::get /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/inline_lazy.rs:30 (epoch_pin_data_race+0x9076b)
    #16 <crossbeam_epoch::default::COLLECTOR as core::ops::deref::Deref>::deref::__stability /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/lib.rs:142 (epoch_pin_data_race+0x9076b)
    #17 <crossbeam_epoch::default::COLLECTOR as core::ops::deref::Deref>::deref /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/lib.rs:144 (epoch_pin_data_race+0x9076b)
    #18 crossbeam_epoch::default::HANDLE::__init /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:18 (epoch_pin_data_race+0x9064d)
    #19 core::ops::function::FnOnce::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x99e02)
    #20 std::thread::local::lazy::LazyKeyInner<T>::initialize /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:304 (epoch_pin_data_race+0x98ba9)
    #21 std::thread::local::fast::Key<T>::try_initialize /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:473 (epoch_pin_data_race+0x90aec)
    #22 std::thread::local::fast::Key<T>::get /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:456 (epoch_pin_data_race+0x90cbf)
    #23 crossbeam_epoch::default::HANDLE::__getit /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:183 (epoch_pin_data_race+0x906c9)
    #24 std::thread::local::LocalKey<T>::try_with /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:271 (epoch_pin_data_race+0x83e4c)
    #25 crossbeam_epoch::default::with_handle /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:43 (epoch_pin_data_race+0x838b8)
    #26 crossbeam_epoch::default::pin /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:24 (epoch_pin_data_race+0x814e2)
    #27 epoch_pin_data_race::main::{{closure}} /home/robin/code/epoch_pin_data_race/src/main.rs:6 (epoch_pin_data_race+0x85982)
    #28 std::sys_common::backtrace::__rust_begin_short_backtrace /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125 (epoch_pin_data_race+0x81aa2)
    #29 std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:474 (epoch_pin_data_race+0x7f802)
    #30 <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:344 (epoch_pin_data_race+0x85382)
    #31 std::panicking::try::do_call /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:379 (epoch_pin_data_race+0x842c4)
    #32 __rust_try 4qd62slf5wbr3hua:? (epoch_pin_data_race+0x8457b)
    #33 std::panicking::try /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:343 (epoch_pin_data_race+0x84083)
    #34 std::panic::catch_unwind /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:431 (epoch_pin_data_race+0x85402)
    #35 std::thread::Builder::spawn_unchecked::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:473 (epoch_pin_data_race+0x7f5bc)
    #36 core::ops::function::FnOnce::call_once{{vtable.shim}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x7fe07)
    #37 <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/alloc/src/boxed.rs:1546 (epoch_pin_data_race+0xbe829)
    #38 <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/alloc/src/boxed.rs:1546 (epoch_pin_data_race+0xbe829)
    #39 std::sys::unix::thread::Thread::new::thread_start /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/thread.rs:71 (epoch_pin_data_race+0xbe829)

  Thread T2 (tid=220509, running) created by main thread at:
    #0 pthread_create /rustc/llvm/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:966 (epoch_pin_data_race+0x11c6b)
    #1 std::sys::unix::thread::Thread::new /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/thread.rs:50 (epoch_pin_data_race+0xbe541)
    #2 std::thread::Builder::spawn /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:381 (epoch_pin_data_race+0x7f902)
    #3 std::thread::spawn /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:620 (epoch_pin_data_race+0x7de61)
    #4 epoch_pin_data_race::main /home/robin/code/epoch_pin_data_race/src/main.rs:9 (epoch_pin_data_race+0x82f46)
    #5 core::ops::function::FnOnce::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x7fea1)
    #6 std::sys_common::backtrace::__rust_begin_short_backtrace /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125 (epoch_pin_data_race+0x81b37)
    #7 std::rt::lang_start::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:66 (epoch_pin_data_race+0x86104)
    #8 core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/core/src/ops/function.rs:259 (epoch_pin_data_race+0xbc946)
    #9 std::panicking::try::do_call /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panicking.rs:379 (epoch_pin_data_race+0xbc946)
    #10 std::panicking::try /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panicking.rs:343 (epoch_pin_data_race+0xbc946)
    #11 std::panic::catch_unwind /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panic.rs:431 (epoch_pin_data_race+0xbc946)
    #12 std::rt::lang_start_internal /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/rt.rs:51 (epoch_pin_data_race+0xbc946)
    #13 main ??:? (epoch_pin_data_race+0x8315a)

  Thread T1 (tid=220508, finished) created by main thread at:
    #0 pthread_create /rustc/llvm/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:966 (epoch_pin_data_race+0x11c6b)
    #1 std::sys::unix::thread::Thread::new /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/thread.rs:50 (epoch_pin_data_race+0xbe541)
    #2 std::thread::Builder::spawn /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:381 (epoch_pin_data_race+0x7f882)
    #3 std::thread::spawn /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:620 (epoch_pin_data_race+0x7dda1)
    #4 epoch_pin_data_race::main /home/robin/code/epoch_pin_data_race/src/main.rs:5 (epoch_pin_data_race+0x82f35)
    #5 core::ops::function::FnOnce::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x7fea1)
    #6 std::sys_common::backtrace::__rust_begin_short_backtrace /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125 (epoch_pin_data_race+0x81b37)
    #7 std::rt::lang_start::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:66 (epoch_pin_data_race+0x86104)
    #8 core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/core/src/ops/function.rs:259 (epoch_pin_data_race+0xbc946)
    #9 std::panicking::try::do_call /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panicking.rs:379 (epoch_pin_data_race+0xbc946)
    #10 std::panicking::try /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panicking.rs:343 (epoch_pin_data_race+0xbc946)
    #11 std::panic::catch_unwind /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panic.rs:431 (epoch_pin_data_race+0xbc946)
    #12 std::rt::lang_start_internal /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/rt.rs:51 (epoch_pin_data_race+0xbc946)
    #13 main ??:? (epoch_pin_data_race+0x8315a)

SUMMARY: ThreadSanitizer: data race /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:2353 in core::sync::atomic::atomic_load
==================
==================
WARNING: ThreadSanitizer: data race (pid=220503)
  Atomic read of size 8 at 0x7b5400000180 by thread T2:
    #0 __tsan_atomic64_load /rustc/llvm/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interface_atomic.cpp:539 (epoch_pin_data_race+0x538ce)
    #1 core::sync::atomic::atomic_load /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:2353 (epoch_pin_data_race+0xa1939)
    #2 core::sync::atomic::AtomicUsize::load /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:1491 (epoch_pin_data_race+0x81e96)
    #3 crossbeam_epoch::epoch::AtomicEpoch::load /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/epoch.rs:93 (epoch_pin_data_race+0x82ba7)
    #4 crossbeam_epoch::internal::Local::pin /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/internal.rs:460 (epoch_pin_data_race+0x87198)
    #5 crossbeam_epoch::collector::LocalHandle::pin /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/collector.rs:81 (epoch_pin_data_race+0x877c4)
    #6 crossbeam_epoch::default::pin::{{closure}} /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:24 (epoch_pin_data_race+0x83af6)
    #7 crossbeam_epoch::default::with_handle::{{closure}} /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:44 (epoch_pin_data_race+0x83970)
    #8 std::thread::local::LocalKey<T>::try_with /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:272 (epoch_pin_data_race+0x83ecc)
    #9 crossbeam_epoch::default::with_handle /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:43 (epoch_pin_data_race+0x838b8)
    #10 crossbeam_epoch::default::pin /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:24 (epoch_pin_data_race+0x814e2)
    #11 epoch_pin_data_race::main::{{closure}} /home/robin/code/epoch_pin_data_race/src/main.rs:10 (epoch_pin_data_race+0x859f2)
    #12 std::sys_common::backtrace::__rust_begin_short_backtrace /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125 (epoch_pin_data_race+0x81a22)
    #13 std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:474 (epoch_pin_data_race+0x7f7c2)
    #14 <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:344 (epoch_pin_data_race+0x853c2)
    #15 std::panicking::try::do_call /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:379 (epoch_pin_data_race+0x84254)
    #16 __rust_try 4qd62slf5wbr3hua:? (epoch_pin_data_race+0x8457b)
    #17 std::panicking::try /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:343 (epoch_pin_data_race+0x84163)
    #18 std::panic::catch_unwind /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:431 (epoch_pin_data_race+0x85452)
    #19 std::thread::Builder::spawn_unchecked::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:473 (epoch_pin_data_race+0x7f24c)
    #20 core::ops::function::FnOnce::call_once{{vtable.shim}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x7fe57)
    #21 <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/alloc/src/boxed.rs:1546 (epoch_pin_data_race+0xbe829)
    #22 <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/alloc/src/boxed.rs:1546 (epoch_pin_data_race+0xbe829)
    #23 std::sys::unix::thread::Thread::new::thread_start /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/thread.rs:71 (epoch_pin_data_race+0xbe829)

  Previous write of size 8 at 0x7b5400000180 by thread T1:
    #0 posix_memalign /rustc/llvm/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:836 (epoch_pin_data_race+0x11a31)
    #1 std::sys::unix::alloc::aligned_malloc /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/alloc.rs:95 (epoch_pin_data_race+0xbb34c)
    #2 std::sys::unix::alloc::<impl core::alloc::global::GlobalAlloc for std::alloc::System>::alloc /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/alloc.rs:22 (epoch_pin_data_race+0xbb34c)
    #3 __rdl_alloc /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/alloc.rs:357 (epoch_pin_data_race+0xbb34c)
    #4 alloc::alloc::Global::alloc_impl /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:166 (epoch_pin_data_race+0x97f57)
    #5 <alloc::alloc::Global as core::alloc::Allocator>::allocate /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:226 (epoch_pin_data_race+0x98b1e)
    #6 alloc::alloc::exchange_malloc /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:316 (epoch_pin_data_race+0x97cb5)
    #7 alloc::sync::Arc<T>::new /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:332 (epoch_pin_data_race+0x91041)
    #8 <crossbeam_epoch::collector::Collector as core::default::Default>::default /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/collector.rs:32 (epoch_pin_data_race+0x99319)
    #9 crossbeam_epoch::collector::Collector::new /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/collector.rs:40 (epoch_pin_data_race+0x99386)
    #10 <crossbeam_epoch::default::COLLECTOR as core::ops::deref::Deref>::deref::__static_ref_initialize /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:13 (epoch_pin_data_race+0x99db6)
    #11 core::ops::function::FnOnce::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x99db6)
    #12 lazy_static::lazy::Lazy<T>::get::{{closure}} /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/inline_lazy.rs:31 (epoch_pin_data_race+0x9024d)
    #13 std::sync::once::Once::call_once::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sync/once.rs:261 (epoch_pin_data_race+0x90a2c)
    #14 std::sync::once::Once::call_inner /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sync/once.rs:418 (epoch_pin_data_race+0xb9be1)
    #15 lazy_static::lazy::Lazy<T>::get /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/inline_lazy.rs:30 (epoch_pin_data_race+0x9076b)
    #16 <crossbeam_epoch::default::COLLECTOR as core::ops::deref::Deref>::deref::__stability /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/lib.rs:142 (epoch_pin_data_race+0x9076b)
    #17 <crossbeam_epoch::default::COLLECTOR as core::ops::deref::Deref>::deref /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/lib.rs:144 (epoch_pin_data_race+0x9076b)
    #18 crossbeam_epoch::default::HANDLE::__init /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:18 (epoch_pin_data_race+0x9064d)
    #19 core::ops::function::FnOnce::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x99e02)
    #20 std::thread::local::lazy::LazyKeyInner<T>::initialize /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:304 (epoch_pin_data_race+0x98ba9)
    #21 std::thread::local::fast::Key<T>::try_initialize /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:473 (epoch_pin_data_race+0x90aec)
    #22 std::thread::local::fast::Key<T>::get /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:456 (epoch_pin_data_race+0x90cbf)
    #23 crossbeam_epoch::default::HANDLE::__getit /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:183 (epoch_pin_data_race+0x906c9)
    #24 std::thread::local::LocalKey<T>::try_with /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:271 (epoch_pin_data_race+0x83e4c)
    #25 crossbeam_epoch::default::with_handle /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:43 (epoch_pin_data_race+0x838b8)
    #26 crossbeam_epoch::default::pin /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:24 (epoch_pin_data_race+0x814e2)
    #27 epoch_pin_data_race::main::{{closure}} /home/robin/code/epoch_pin_data_race/src/main.rs:6 (epoch_pin_data_race+0x85982)
    #28 std::sys_common::backtrace::__rust_begin_short_backtrace /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125 (epoch_pin_data_race+0x81aa2)
    #29 std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:474 (epoch_pin_data_race+0x7f802)
    #30 <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:344 (epoch_pin_data_race+0x85382)
    #31 std::panicking::try::do_call /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:379 (epoch_pin_data_race+0x842c4)
    #32 __rust_try 4qd62slf5wbr3hua:? (epoch_pin_data_race+0x8457b)
    #33 std::panicking::try /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:343 (epoch_pin_data_race+0x84083)
    #34 std::panic::catch_unwind /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:431 (epoch_pin_data_race+0x85402)
    #35 std::thread::Builder::spawn_unchecked::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:473 (epoch_pin_data_race+0x7f5bc)
    #36 core::ops::function::FnOnce::call_once{{vtable.shim}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x7fe07)
    #37 <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/alloc/src/boxed.rs:1546 (epoch_pin_data_race+0xbe829)
    #38 <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/alloc/src/boxed.rs:1546 (epoch_pin_data_race+0xbe829)
    #39 std::sys::unix::thread::Thread::new::thread_start /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/thread.rs:71 (epoch_pin_data_race+0xbe829)

  Location is heap block of size 640 at 0x7b5400000000 allocated by thread T1:
    #0 posix_memalign /rustc/llvm/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:836 (epoch_pin_data_race+0x11a31)
    #1 std::sys::unix::alloc::aligned_malloc /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/alloc.rs:95 (epoch_pin_data_race+0xbb34c)
    #2 std::sys::unix::alloc::<impl core::alloc::global::GlobalAlloc for std::alloc::System>::alloc /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/alloc.rs:22 (epoch_pin_data_race+0xbb34c)
    #3 __rdl_alloc /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/alloc.rs:357 (epoch_pin_data_race+0xbb34c)
    #4 alloc::alloc::Global::alloc_impl /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:166 (epoch_pin_data_race+0x97f57)
    #5 <alloc::alloc::Global as core::alloc::Allocator>::allocate /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:226 (epoch_pin_data_race+0x98b1e)
    #6 alloc::alloc::exchange_malloc /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:316 (epoch_pin_data_race+0x97cb5)
    #7 alloc::sync::Arc<T>::new /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:332 (epoch_pin_data_race+0x91041)
    #8 <crossbeam_epoch::collector::Collector as core::default::Default>::default /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/collector.rs:32 (epoch_pin_data_race+0x99319)
    #9 crossbeam_epoch::collector::Collector::new /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/collector.rs:40 (epoch_pin_data_race+0x99386)
    #10 <crossbeam_epoch::default::COLLECTOR as core::ops::deref::Deref>::deref::__static_ref_initialize /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:13 (epoch_pin_data_race+0x99db6)
    #11 core::ops::function::FnOnce::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x99db6)
    #12 lazy_static::lazy::Lazy<T>::get::{{closure}} /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/inline_lazy.rs:31 (epoch_pin_data_race+0x9024d)
    #13 std::sync::once::Once::call_once::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sync/once.rs:261 (epoch_pin_data_race+0x90a2c)
    #14 std::sync::once::Once::call_inner /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sync/once.rs:418 (epoch_pin_data_race+0xb9be1)
    #15 lazy_static::lazy::Lazy<T>::get /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/inline_lazy.rs:30 (epoch_pin_data_race+0x9076b)
    #16 <crossbeam_epoch::default::COLLECTOR as core::ops::deref::Deref>::deref::__stability /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/lib.rs:142 (epoch_pin_data_race+0x9076b)
    #17 <crossbeam_epoch::default::COLLECTOR as core::ops::deref::Deref>::deref /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/lib.rs:144 (epoch_pin_data_race+0x9076b)
    #18 crossbeam_epoch::default::HANDLE::__init /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:18 (epoch_pin_data_race+0x9064d)
    #19 core::ops::function::FnOnce::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x99e02)
    #20 std::thread::local::lazy::LazyKeyInner<T>::initialize /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:304 (epoch_pin_data_race+0x98ba9)
    #21 std::thread::local::fast::Key<T>::try_initialize /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:473 (epoch_pin_data_race+0x90aec)
    #22 std::thread::local::fast::Key<T>::get /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:456 (epoch_pin_data_race+0x90cbf)
    #23 crossbeam_epoch::default::HANDLE::__getit /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:183 (epoch_pin_data_race+0x906c9)
    #24 std::thread::local::LocalKey<T>::try_with /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:271 (epoch_pin_data_race+0x83e4c)
    #25 crossbeam_epoch::default::with_handle /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:43 (epoch_pin_data_race+0x838b8)
    #26 crossbeam_epoch::default::pin /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.9.1/src/default.rs:24 (epoch_pin_data_race+0x814e2)
    #27 epoch_pin_data_race::main::{{closure}} /home/robin/code/epoch_pin_data_race/src/main.rs:6 (epoch_pin_data_race+0x85982)
    #28 std::sys_common::backtrace::__rust_begin_short_backtrace /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125 (epoch_pin_data_race+0x81aa2)
    #29 std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:474 (epoch_pin_data_race+0x7f802)
    #30 <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:344 (epoch_pin_data_race+0x85382)
    #31 std::panicking::try::do_call /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:379 (epoch_pin_data_race+0x842c4)
    #32 __rust_try 4qd62slf5wbr3hua:? (epoch_pin_data_race+0x8457b)
    #33 std::panicking::try /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:343 (epoch_pin_data_race+0x84083)
    #34 std::panic::catch_unwind /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:431 (epoch_pin_data_race+0x85402)
    #35 std::thread::Builder::spawn_unchecked::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:473 (epoch_pin_data_race+0x7f5bc)
    #36 core::ops::function::FnOnce::call_once{{vtable.shim}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x7fe07)
    #37 <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/alloc/src/boxed.rs:1546 (epoch_pin_data_race+0xbe829)
    #38 <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/alloc/src/boxed.rs:1546 (epoch_pin_data_race+0xbe829)
    #39 std::sys::unix::thread::Thread::new::thread_start /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/thread.rs:71 (epoch_pin_data_race+0xbe829)

  Thread T2 (tid=220509, running) created by main thread at:
    #0 pthread_create /rustc/llvm/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:966 (epoch_pin_data_race+0x11c6b)
    #1 std::sys::unix::thread::Thread::new /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/thread.rs:50 (epoch_pin_data_race+0xbe541)
    #2 std::thread::Builder::spawn /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:381 (epoch_pin_data_race+0x7f902)
    #3 std::thread::spawn /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:620 (epoch_pin_data_race+0x7de61)
    #4 epoch_pin_data_race::main /home/robin/code/epoch_pin_data_race/src/main.rs:9 (epoch_pin_data_race+0x82f46)
    #5 core::ops::function::FnOnce::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x7fea1)
    #6 std::sys_common::backtrace::__rust_begin_short_backtrace /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125 (epoch_pin_data_race+0x81b37)
    #7 std::rt::lang_start::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:66 (epoch_pin_data_race+0x86104)
    #8 core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/core/src/ops/function.rs:259 (epoch_pin_data_race+0xbc946)
    #9 std::panicking::try::do_call /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panicking.rs:379 (epoch_pin_data_race+0xbc946)
    #10 std::panicking::try /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panicking.rs:343 (epoch_pin_data_race+0xbc946)
    #11 std::panic::catch_unwind /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panic.rs:431 (epoch_pin_data_race+0xbc946)
    #12 std::rt::lang_start_internal /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/rt.rs:51 (epoch_pin_data_race+0xbc946)
    #13 main ??:? (epoch_pin_data_race+0x8315a)

  Thread T1 (tid=220508, finished) created by main thread at:
    #0 pthread_create /rustc/llvm/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:966 (epoch_pin_data_race+0x11c6b)
    #1 std::sys::unix::thread::Thread::new /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/thread.rs:50 (epoch_pin_data_race+0xbe541)
    #2 std::thread::Builder::spawn /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:381 (epoch_pin_data_race+0x7f882)
    #3 std::thread::spawn /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:620 (epoch_pin_data_race+0x7dda1)
    #4 epoch_pin_data_race::main /home/robin/code/epoch_pin_data_race/src/main.rs:5 (epoch_pin_data_race+0x82f35)
    #5 core::ops::function::FnOnce::call_once /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227 (epoch_pin_data_race+0x7fea1)
    #6 std::sys_common::backtrace::__rust_begin_short_backtrace /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125 (epoch_pin_data_race+0x81b37)
    #7 std::rt::lang_start::{{closure}} /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:66 (epoch_pin_data_race+0x86104)
    #8 core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/core/src/ops/function.rs:259 (epoch_pin_data_race+0xbc946)
    #9 std::panicking::try::do_call /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panicking.rs:379 (epoch_pin_data_race+0xbc946)
    #10 std::panicking::try /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panicking.rs:343 (epoch_pin_data_race+0xbc946)
    #11 std::panic::catch_unwind /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panic.rs:431 (epoch_pin_data_race+0xbc946)
    #12 std::rt::lang_start_internal /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/rt.rs:51 (epoch_pin_data_race+0xbc946)
    #13 main ??:? (epoch_pin_data_race+0x8315a)

SUMMARY: ThreadSanitizer: data race /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:2353 in core::sync::atomic::atomic_load
==================
ThreadSanitizer: reported 4 warnings

I found #589 but I wasn't sure if this is a duplicate of that issue or not.

@taiki-e
Copy link
Member

taiki-e commented Feb 20, 2021

epoch::pin uses Local::pin which uses fences, which tsan doesn't understand. (This was also mentioned in tokio-rs/tokio#329 (comment) that mentioned in #589)

// Now we must store `new_epoch` into `self.epoch` and execute a `SeqCst` fence.
// The fence makes sure that any future loads from `Atomic`s will not happen before
// this store.

So you have to use a tsan suppressions file like we use: https://github.com/crossbeam-rs/crossbeam/blob/master/ci/tsan

By the way, also note that using tsan without -Z build-std can lead to many false positives: https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/sanitizer.html#instrumentation-of-external-dependencies-and-std

@robinhundt
Copy link
Author

Ah yes, I found those issues but it wasn't immediately clear to me that it would be the same problem.
Thanks for the pointer to the docs, I must've missed that note when looking at them earlier 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants