You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2016/11/04 19:53:56 UTC
[trafficserver] branch master updated: TS-5034: Add a --enable-tsan
configure option
This is an automated email from the ASF dual-hosted git repository.
bcall pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new b7e0f82 TS-5034: Add a --enable-tsan configure option
b7e0f82 is described below
commit b7e0f8285b2994175960bab753af8f54c4ac9a62
Author: Bryan Call <bc...@apache.org>
AuthorDate: Thu Nov 3 15:29:12 2016 -0700
TS-5034: Add a --enable-tsan configure option
---
configure.ac | 18 ++++++++++++++++++
proxy/CoreUtils.cc | 2 +-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index ae18989..d9c51aa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -197,6 +197,15 @@ AC_ARG_ENABLE([asan],
)
AC_MSG_RESULT([$enable_asan])
+# Enable TSAN for the builds
+AC_MSG_CHECKING([whether to enable tsan])
+AC_ARG_ENABLE([tsan],
+ [AS_HELP_STRING([--enable-tsan],[turn on Thread Sanitizer])],
+ [],
+ [enable_tsan=no]
+)
+AC_MSG_RESULT([$enable_tsan])
+
#
# Fast SDK APIs, this disables the parameter checks (assert)
# on all APIs.
@@ -913,10 +922,19 @@ fi
# Flags for ASAN
if test "x${enable_asan}" = "xyes"; then
+ if test "x${enable_tsan}" = "xyes"; then
+ AC_ERROR([Cannot have ASAN and TSAN options at the same time, pick one])
+ fi
TS_ADDTO(CFLAGS, [-fno-omit-frame-pointer -fsanitize=address])
TS_ADDTO(CXXFLAGS, [-fno-omit-frame-pointer -fsanitize=address])
fi
+# Flags for TSAN
+if test "x${enable_tsan}" = "xyes"; then
+ TS_ADDTO(CFLAGS, [-fsanitize=thread])
+ TS_ADDTO(CXXFLAGS, [-fsanitize=thread])
+fi
+
# Checks for pointer size.
# TODO: Later this is irrelevant, and we should just bail on 32-bit platforms always
AC_CHECK_SIZEOF([void*])
diff --git a/proxy/CoreUtils.cc b/proxy/CoreUtils.cc
index 02bfcee..95bd9e4 100644
--- a/proxy/CoreUtils.cc
+++ b/proxy/CoreUtils.cc
@@ -390,7 +390,7 @@ CoreUtils::test_HttpSM_from_tunnel(void *arg)
char *tmp = (char *)arg;
intptr_t offset = (intptr_t) & (((HttpTunnel *)nullptr)->sm);
HttpSM **hsm_ptr = (HttpSM **)(tmp + offset);
- HttpSM *hsm_test;
+ HttpSM *hsm_test = nullptr;
if (read_from_core((intptr_t)hsm_ptr, sizeof(HttpSM *), (char *)&hsm_test) == 0) {
return;
--
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].