From e0ab11af2923a2fb1757afd7bc34ded3886e8aae Mon Sep 17 00:00:00 2001 From: zhangjinpeng1987 Date: Wed, 8 Jun 2022 17:11:21 +0800 Subject: [PATCH 1/3] threadsanitizer: add tsan for crossbeam Signed-off-by: zhangjinpeng1987 --- .github/workflows/test.yml | 1 + .github/workflows/tsan | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 .github/workflows/tsan diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e145ba74..443bc549 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -84,4 +84,5 @@ jobs: command: test args: --all-features -Zbuild-std --target x86_64-unknown-linux-gnu env: + TSAN_OPTIONS="suppressions=$(pwd)/.github/workflows/tsan" RUSTFLAGS: "-Zsanitizer=${{ matrix.sanitizer }}" diff --git a/.github/workflows/tsan b/.github/workflows/tsan new file mode 100644 index 00000000..295557cf --- /dev/null +++ b/.github/workflows/tsan @@ -0,0 +1,14 @@ +# TSAN suppressions file for crossbeam + +# The epoch-based GC uses fences. +race:crossbeam_epoch + +# Push and steal operations in crossbeam-deque may cause data races, but such +# data races are safe. If a data race happens, the value read by `steal` is +# forgotten and the steal operation is then retried. +race:crossbeam_deque*push +race:crossbeam_deque*steal + +# Non-lock-free AtomicCell uses SeqLock which uses fences. +race:crossbeam_utils::atomic::atomic_cell::AtomicCell::compare_exchange + From ff3e1162b52a7df95b984b2a8ea0294494b052b5 Mon Sep 17 00:00:00 2001 From: zhangjinpeng1987 Date: Wed, 8 Jun 2022 17:13:42 +0800 Subject: [PATCH 2/3] address env assignment Signed-off-by: zhangjinpeng1987 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 443bc549..d9736d3e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -84,5 +84,5 @@ jobs: command: test args: --all-features -Zbuild-std --target x86_64-unknown-linux-gnu env: - TSAN_OPTIONS="suppressions=$(pwd)/.github/workflows/tsan" + TSAN_OPTIONS: "suppressions=$(pwd)/.github/workflows/tsan" RUSTFLAGS: "-Zsanitizer=${{ matrix.sanitizer }}" From 8785558b220610b6b99ae187bc21bc24ab5d57d2 Mon Sep 17 00:00:00 2001 From: zhangjinpeng1987 Date: Wed, 8 Jun 2022 17:22:40 +0800 Subject: [PATCH 3/3] address tsan path Signed-off-by: zhangjinpeng1987 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d9736d3e..efb849c9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -84,5 +84,5 @@ jobs: command: test args: --all-features -Zbuild-std --target x86_64-unknown-linux-gnu env: - TSAN_OPTIONS: "suppressions=$(pwd)/.github/workflows/tsan" + TSAN_OPTIONS: "suppressions=.github/workflows/tsan" RUSTFLAGS: "-Zsanitizer=${{ matrix.sanitizer }}"