aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-04-24 13:42:52 -0700
committerGravatar Craig Tiller <ctiller@google.com>2017-04-24 13:42:52 -0700
commit25149249ec74eade6af512f2573c694c34fab9fd (patch)
treee1c9bd64945ce6112e19fbccea19c1a44d0fdd56
parent731adcc0b4b06de05444bfbd65a3a1d9aaa3ecaf (diff)
Slow down timers for ubsan builds
-rw-r--r--Makefile2
-rw-r--r--build.yaml2
-rw-r--r--test/core/util/test_config.c10
3 files changed, 12 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index a650655a7d..58a36332d5 100644
--- a/Makefile
+++ b/Makefile
@@ -174,7 +174,7 @@ LD_ubsan = clang
LDXX_ubsan = clang++
CPPFLAGS_ubsan = -O0 -fsanitize-coverage=edge -fsanitize=undefined -fno-omit-frame-pointer -Wno-unused-command-line-argument -Wvarargs
LDFLAGS_ubsan = -fsanitize=undefined,unsigned-integer-overflow
-DEFINES_ubsan = NDEBUG
+DEFINES_ubsan = NDEBUG GRPC_UBSAN
VALID_CONFIG_tsan = 1
REQUIRE_CUSTOM_LIBRARIES_tsan = 1
diff --git a/build.yaml b/build.yaml
index 58a474aabf..5791402f57 100644
--- a/build.yaml
+++ b/build.yaml
@@ -4464,7 +4464,7 @@ configs:
CPPFLAGS: -O0 -fsanitize-coverage=edge -fsanitize=undefined -fno-omit-frame-pointer
-Wno-unused-command-line-argument -Wvarargs
CXX: clang++
- DEFINES: NDEBUG
+ DEFINES: NDEBUG GRPC_UBSAN
LD: clang
LDFLAGS: -fsanitize=undefined,unsigned-integer-overflow
LDXX: clang++
diff --git a/test/core/util/test_config.c b/test/core/util/test_config.c
index 0180d6f08d..9a400c54ca 100644
--- a/test/core/util/test_config.c
+++ b/test/core/util/test_config.c
@@ -348,6 +348,14 @@ bool BuiltUnderMsan() {
#endif
}
+bool BuiltUnderUbsan() {
+#ifdef GRPC_UBSAN
+ return true;
+#else
+ return false;
+#endif
+}
+
int64_t grpc_test_sanitizer_slowdown_factor() {
int64_t sanitizer_multiplier = 1;
if (BuiltUnderValgrind()) {
@@ -358,6 +366,8 @@ int64_t grpc_test_sanitizer_slowdown_factor() {
sanitizer_multiplier = 3;
} else if (BuiltUnderMsan()) {
sanitizer_multiplier = 4;
+ } else if (BuiltUnderUbsan()) {
+ sanitizer_multiplier = 5;
}
return sanitizer_multiplier;
}