Skip to content

Commit 5f93959

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 5f93959

File tree

6 files changed

+31
-2
lines changed

6 files changed

+31
-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: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
load("@rules_cc//cc:defs.bzl", _cc_test = "cc_test")
16+
load("@rules_fuzzing//fuzzing:cc_defs.bzl", _cc_fuzz_test = "cc_fuzz_test")
17+
18+
def cc_test(data = [], **kwargs):
19+
_cc_test(data = data + ["//bazel:tsan_suppressions.txt"], **kwargs)
20+
21+
def cc_fuzz_test(data = [], **kwargs):
22+
_cc_fuzz_test(data = data + ["//bazel:tsan_suppressions.txt"], **kwargs)

bazel/tsan_suppressions.txt

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

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)