Skip to content

Commit bec3c9b

Browse files
committed
chore: Silence tsan warnings inside V8
These warnings flag a Join() function protected by a mutex. Such a function marks that the racy operation has ended. Signed-off-by: Matt Leon <[email protected]>
1 parent 0c4eef1 commit bec3c9b

File tree

6 files changed

+17
-2
lines changed

6 files changed

+17
-2
lines changed

.bazelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ build:clang-tsan --config=clang-xsan
5555
build:clang-tsan --copt -DTHREAD_SANITIZER=1
5656
build:clang-tsan --copt -fsanitize=thread
5757
build:clang-tsan --linkopt -fsanitize=thread
58+
build:clang-tsan --test_env=TSAN_OPTIONS=suppressions=bazel/tsan_suppressions.txt
5859

5960
# Use Clang-Tidy tool.
6061
build:clang-tidy --config=clang

bazel/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,5 @@ selects.config_setting_group(
6868
":linux_s390x",
6969
],
7070
)
71+
72+
exports_files(["tsan_suppressions.txt"])

bazel/cc_defs.bzl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
load("@rules_cc//cc:defs.bzl", _cc_test = "cc_test")
2+
load("@rules_fuzzing//fuzzing:cc_defs.bzl", _cc_fuzz_test = "cc_fuzz_test")
3+
4+
def cc_test(data=[], **kwargs):
5+
_cc_test(data = data + ['//bazel:tsan_suppressions.txt'], **kwargs)
6+
7+
def cc_fuzz_test(data=[], **kwargs):
8+
_cc_fuzz_test(data = data + ['//bazel:tsan_suppressions.txt'], **kwargs)
9+

bazel/tsan_suppressions.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# False positive in V8 worker shutdown
2+
race:v8::platform::DefaultJobHandle::Join

test/BUILD

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
# limitations under the License.
1414

1515
load("@proxy_wasm_cpp_host//bazel:select.bzl", "proxy_wasm_select_engine_null")
16-
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
16+
load("@rules_cc//cc:defs.bzl", "cc_library")
17+
load("//bazel:cc_defs.bzl", "cc_test")
1718

1819
licenses(["notice"]) # Apache 2
1920

test/fuzz/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
load("@rules_fuzzing//fuzzing:cc_defs.bzl", "cc_fuzz_test")
15+
load("//bazel:cc_defs.bzl", "cc_fuzz_test")
1616

1717
licenses(["notice"]) # Apache 2
1818

0 commit comments

Comments
 (0)