Skip to content

Commit

Permalink
Merge pull request grpc#15785 from adelez/suppressions
Browse files Browse the repository at this point in the history
Add suppressions to bazel TSAN build (take 2)
  • Loading branch information
adelez committed Jun 18, 2018
2 parents 1da7589 + 1f3d714 commit 8c39827
Show file tree
Hide file tree
Showing 19 changed files with 42 additions and 13 deletions.
3 changes: 2 additions & 1 deletion bazel/grpc_build_system.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def _maybe_update_cc_library_hdrs(hdrs):
def grpc_cc_library(name, srcs = [], public_hdrs = [], hdrs = [],
external_deps = [], deps = [], standalone = False,
language = "C++", testonly = False, visibility = None,
alwayslink = 0):
alwayslink = 0, data = []):
copts = []
if language.upper() == "C":
copts = if_not_windows(["-std=c99"])
Expand All @@ -85,6 +85,7 @@ def grpc_cc_library(name, srcs = [], public_hdrs = [], hdrs = [],
"include"
],
alwayslink = alwayslink,
data = data,
)

def grpc_proto_plugin(name, srcs = [], deps = []):
Expand Down
8 changes: 4 additions & 4 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5494,7 +5494,7 @@ configs:
compile_the_world: true
test_environ:
ASAN_OPTIONS: detect_leaks=1:color=always
LSAN_OPTIONS: suppressions=tools/lsan_suppressions.txt:report_objects=1
LSAN_OPTIONS: suppressions=test/core/util/lsan_suppressions.txt:report_objects=1
asan-noleaks:
CC: clang
CPPFLAGS: -O0 -fsanitize-coverage=edge,trace-pc-guard -fsanitize=address -fno-omit-frame-pointer
Expand All @@ -5518,7 +5518,7 @@ configs:
compile_the_world: true
test_environ:
ASAN_OPTIONS: detect_leaks=1:color=always
LSAN_OPTIONS: suppressions=tools/lsan_suppressions.txt:report_objects=1
LSAN_OPTIONS: suppressions=test/core/util/lsan_suppressions.txt:report_objects=1
basicprof:
CPPFLAGS: -O2 -DGRPC_BASIC_PROFILER -DGRPC_TIMERS_RDTSC
DEFINES: NDEBUG
Expand Down Expand Up @@ -5592,7 +5592,7 @@ configs:
LDXX: clang++
compile_the_world: true
test_environ:
TSAN_OPTIONS: suppressions=tools/tsan_suppressions.txt:halt_on_error=1:second_deadlock_stack=1
TSAN_OPTIONS: suppressions=test/core/util/tsan_suppressions.txt:halt_on_error=1:second_deadlock_stack=1
ubsan:
CC: clang
CPPFLAGS: -O0 -fsanitize-coverage=edge,trace-pc-guard -fsanitize=undefined -fno-omit-frame-pointer
Expand All @@ -5604,7 +5604,7 @@ configs:
LDXX: clang++
compile_the_world: true
test_environ:
UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1:suppressions=tools/ubsan_suppressions.txt
UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1:suppressions=test/core/util/ubsan_suppressions.txt
defaults:
ares:
CFLAGS: -Wno-sign-conversion $(if $(subst Darwin,,$(SYSTEM)),,-Wno-shorten-64-to-32)
Expand Down
1 change: 1 addition & 0 deletions test/core/channel/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ grpc_cc_test(
language = "C++",
deps = [
"//:grpc",
"//test/core/util:gpr_test_util",
],
external_deps = [
"gtest",
Expand Down
4 changes: 4 additions & 0 deletions test/core/security/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ grpc_cc_test(
"//:gpr",
"//:gpr_base",
"//:grpc",
"//test/core/util:gpr_test_util",
],
)

Expand All @@ -195,6 +196,7 @@ grpc_cc_test(
"//:gpr",
"//:gpr_base",
"//:grpc",
"//test/core/util:gpr_test_util",
],
)

Expand All @@ -206,6 +208,7 @@ grpc_cc_test(
"//:alts_util",
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
],
)

Expand All @@ -220,5 +223,6 @@ grpc_cc_test(
"//:grpc_secure",
"//:tsi",
"//:tsi_interface",
"//test/core/util:gpr_test_util",
],
)
1 change: 1 addition & 0 deletions test/core/transport/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ grpc_cc_test(
language = "C++",
deps = [
"//:grpc",
"//test/core/util:gpr_test_util",
],
external_deps = [
"gtest",
Expand Down
1 change: 1 addition & 0 deletions test/core/tsi/alts/crypt/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ grpc_cc_test(
"//:alts_frame_protector",
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
],
)

Expand Down
4 changes: 4 additions & 0 deletions test/core/tsi/alts/frame_protector/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ grpc_cc_test(
"//:gpr",
"//:grpc",
"//test/core/tsi/alts/crypt:alts_crypt_test_util",
"//test/core/util:gpr_test_util",
],
)

Expand All @@ -39,6 +40,7 @@ grpc_cc_test(
"//:gpr",
"//:grpc",
"//test/core/tsi/alts/crypt:alts_crypt_test_util",
"//test/core/util:gpr_test_util",
],
)

Expand All @@ -54,6 +56,7 @@ grpc_cc_test(
"//:tsi_interface",
"//test/core/tsi/alts/crypt:alts_crypt_test_util",
"//test/core/tsi:transport_security_test_lib",
"//test/core/util:gpr_test_util",
],
)

Expand All @@ -67,5 +70,6 @@ grpc_cc_test(
"//:gpr_base",
"//:grpc",
"//test/core/tsi/alts/crypt:alts_crypt_test_util",
"//test/core/util:gpr_test_util",
],
)
5 changes: 5 additions & 0 deletions test/core/tsi/alts/handshaker/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ grpc_cc_test(
"//:tsi",
"//:tsi_interface",
"//:grpc",
"//test/core/util:gpr_test_util",
],
)

Expand All @@ -47,6 +48,7 @@ grpc_cc_test(
deps = [
":alts_handshaker_service_api_test_lib",
"//:grpc",
"//test/core/util:gpr_test_util",
],
)

Expand All @@ -60,6 +62,7 @@ grpc_cc_test(
"//:gpr_base",
"//:grpc",
"//:tsi",
"//test/core/util:gpr_test_util",
],
)

Expand All @@ -71,6 +74,7 @@ grpc_cc_test(
":alts_handshaker_service_api_test_lib",
"//:grpc",
"//:tsi",
"//test/core/util:gpr_test_util",
],
)

Expand All @@ -81,6 +85,7 @@ grpc_cc_test(
deps = [
"//:alts_util",
"//:grpc",
"//test/core/util:gpr_test_util",
],
)

3 changes: 3 additions & 0 deletions test/core/tsi/alts/zero_copy_frame_protector/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ grpc_cc_test(
"//:grpc",
"//:grpc_base_c",
"//test/core/tsi/alts/crypt:alts_crypt_test_util",
"//test/core/util:gpr_test_util",
],
)

Expand All @@ -40,6 +41,7 @@ grpc_cc_test(
"//:gpr",
"//:grpc",
"//test/core/tsi/alts/crypt:alts_crypt_test_util",
"//test/core/util:gpr_test_util",
],
)

Expand All @@ -53,5 +55,6 @@ grpc_cc_test(
"//:grpc",
"//:grpc_base_c",
"//test/core/tsi/alts/crypt:alts_crypt_test_util",
"//test/core/util:gpr_test_util",
],
)
5 changes: 5 additions & 0 deletions test/core/util/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ grpc_cc_library(
"test_config.h",
],
deps = ["//:gpr"],
data = [
"lsan_suppressions.txt",
"tsan_suppressions.txt",
"ubsan_suppressions.txt",
],
)

grpc_cc_library(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions test/cpp/client/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ grpc_cc_test(
"//:gpr",
"//:grpc",
"//:grpc++",
"//test/core/util:gpr_test_util",
],
)

Expand Down
1 change: 1 addition & 0 deletions test/cpp/microbenchmarks/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ grpc_cc_test(
external_deps = [
"benchmark",
],
deps = ["//test/core/util:gpr_test_util",]
)

grpc_cc_library(
Expand Down
2 changes: 2 additions & 0 deletions test/cpp/util/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ grpc_cc_test(
],
deps = [
"//:grpc++",
"//test/core/util:gpr_test_util",
],
)

Expand Down Expand Up @@ -260,6 +261,7 @@ grpc_cc_test(
deps = [
"//:grpc++_error_details",
"//src/proto/grpc/testing:echo_messages_proto",
"//test/core/util:gpr_test_util",
],
)

Expand Down
6 changes: 3 additions & 3 deletions tools/bazel.rc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ build:asan --copt -fno-omit-frame-pointer
build:asan --copt -DGPR_NO_DIRECT_SYSCALLS
build:asan --linkopt -fsanitize=address
build:asan --action_env=ASAN_OPTIONS=detect_leaks=1:color=always
build:asan --action_env=LSAN_OPTIONS=suppressions=lsan_suppressions.txt:report_objects=1
build:asan --action_env=LSAN_OPTIONS=suppressions=test/core/util/lsan_suppressions.txt:report_objects=1

build:msan --strip=never
build:msan --copt -fsanitize-coverage=edge
Expand All @@ -32,7 +32,7 @@ build:tsan --copt -fno-omit-frame-pointer
build:tsan --copt -DGPR_NO_DIRECT_SYSCALLS
build:tsan --copt -DGRPC_TSAN
build:tsan --linkopt -fsanitize=thread
build:tsan --action_env=TSAN_OPTIONS=suppressions=tools/tsan_suppressions.txt:halt_on_error=1:second_deadlock_stack=1
build:tsan --action_env=TSAN_OPTIONS=suppressions=test/core/util/tsan_suppressions.txt:halt_on_error=1:second_deadlock_stack=1

build:ubsan --strip=never
build:ubsan --copt -fsanitize-coverage=edge
Expand All @@ -42,7 +42,7 @@ build:ubsan --copt -DGRPC_UBSAN
build:ubsan --copt -DNDEBUG
build:ubsan --copt -fno-sanitize=function,vptr
build:ubsan --linkopt -fsanitize=undefined
build:ubsan --action_env=UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1:suppressions=tools/ubsan_suppressions.txt
build:ubsan --action_env=UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1:suppressions=test/core/util/ubsan_suppressions.txt

build:basicprof --strip=never
build:basicprof --copt -DNDEBUG
Expand Down
2 changes: 1 addition & 1 deletion tools/internal_ci/linux/grpc_tsan_on_foundry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# limitations under the License.

export UPLOAD_TEST_RESULTS=true
EXTRA_FLAGS="--copt=-gmlt --strip=never --copt=-fsanitize=thread --linkopt=-fsanitize=thread --test_timeout=3600"
EXTRA_FLAGS="--copt=-gmlt --strip=never --copt=-fsanitize=thread --linkopt=-fsanitize=thread --test_timeout=3600 --action_env=TSAN_OPTIONS=suppressions=test/core/util/tsan_suppressions.txt:halt_on_error=1:second_deadlock_stack=1"
github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh "${EXTRA_FLAGS}"
8 changes: 4 additions & 4 deletions tools/run_tests/generated/configs.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"config": "asan-trace-cmp",
"environ": {
"ASAN_OPTIONS": "detect_leaks=1:color=always",
"LSAN_OPTIONS": "suppressions=tools/lsan_suppressions.txt:report_objects=1"
"LSAN_OPTIONS": "suppressions=test/core/util/lsan_suppressions.txt:report_objects=1"
}
},
{
Expand All @@ -16,7 +16,7 @@
"config": "asan",
"environ": {
"ASAN_OPTIONS": "detect_leaks=1:color=always",
"LSAN_OPTIONS": "suppressions=tools/lsan_suppressions.txt:report_objects=1"
"LSAN_OPTIONS": "suppressions=test/core/util/lsan_suppressions.txt:report_objects=1"
}
},
{
Expand Down Expand Up @@ -47,13 +47,13 @@
{
"config": "ubsan",
"environ": {
"UBSAN_OPTIONS": "halt_on_error=1:print_stacktrace=1:suppressions=tools/ubsan_suppressions.txt"
"UBSAN_OPTIONS": "halt_on_error=1:print_stacktrace=1:suppressions=test/core/util/ubsan_suppressions.txt"
}
},
{
"config": "tsan",
"environ": {
"TSAN_OPTIONS": "suppressions=tools/tsan_suppressions.txt:halt_on_error=1:second_deadlock_stack=1"
"TSAN_OPTIONS": "suppressions=test/core/util/tsan_suppressions.txt:halt_on_error=1:second_deadlock_stack=1"
}
},
{
Expand Down

0 comments on commit 8c39827

Please sign in to comment.