From a1be8f6df34212998121ed718e0becab61540d3c Mon Sep 17 00:00:00 2001 From: Dmitri Dolguikh Date: Wed, 15 Jul 2020 14:17:28 -0700 Subject: [PATCH 1/4] Switch to a tsan-instrumented libc++ for tsan tests This fixes https://github.com/envoyproxy/envoy/issues/9784 Signed-off-by: Dmitri Dolguikh --- .bazelrc | 8 ++++++++ test/integration/BUILD | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index 17cd6008e399..5d29db5979fa 100644 --- a/.bazelrc +++ b/.bazelrc @@ -161,6 +161,10 @@ build:rbe-toolchain-msan --linkopt=-L/opt/libcxx_msan/lib build:rbe-toolchain-msan --linkopt=-Wl,-rpath,/opt/libcxx_msan/lib build:rbe-toolchain-msan --config=clang-msan +build:rbe-toolchain-tsan --linkopt=-L/opt/libcxx_tsan/lib +build:rbe-toolchain-tsan --linkopt=-Wl,-rpath,/opt/libcxx_tsan/lib +build:rbe-toolchain-tsan --config=clang-tsan + build:rbe-toolchain-gcc --config=rbe-toolchain build:rbe-toolchain-gcc --platforms=@rbe_ubuntu_gcc//config:platform build:rbe-toolchain-gcc --host_platform=@rbe_ubuntu_gcc//config:platform @@ -229,6 +233,10 @@ build:docker-msan --config=docker-sandbox build:docker-msan --config=rbe-toolchain-clang-libc++ build:docker-msan --config=rbe-toolchain-msan +build:docker-tsan --config=docker-sandbox +build:docker-tsan --config=rbe-toolchain-clang-libc++ +build:docker-tsan --config=rbe-toolchain-tsan + # CI configurations build:remote-ci --remote_cache=grpcs://remotebuildexecution.googleapis.com build:remote-ci --remote_executor=grpcs://remotebuildexecution.googleapis.com diff --git a/test/integration/BUILD b/test/integration/BUILD index 2efec82ce37b..a7bc08635fdc 100644 --- a/test/integration/BUILD +++ b/test/integration/BUILD @@ -220,7 +220,6 @@ envoy_cc_test( tags = [ "fails_on_windows", # https://github.com/envoyproxy/envoy/issues/9784 - "no_tsan", ], deps = [ ":http_integration_lib", From 2c0bcf6b31546f61de9850479288a259f0cd4198 Mon Sep 17 00:00:00 2001 From: Dmitri Dolguikh Date: Thu, 16 Jul 2020 13:24:43 -0700 Subject: [PATCH 2/4] Responded to feedback Signed-off-by: Dmitri Dolguikh --- test/integration/BUILD | 1 - 1 file changed, 1 deletion(-) diff --git a/test/integration/BUILD b/test/integration/BUILD index a7bc08635fdc..b08549380079 100644 --- a/test/integration/BUILD +++ b/test/integration/BUILD @@ -219,7 +219,6 @@ envoy_cc_test( ], tags = [ "fails_on_windows", - # https://github.com/envoyproxy/envoy/issues/9784 ], deps = [ ":http_integration_lib", From dd17eaaeea7340c90a73a56032e48c664eca944d Mon Sep 17 00:00:00 2001 From: Dmitri Dolguikh Date: Thu, 16 Jul 2020 13:38:40 -0700 Subject: [PATCH 3/4] Switch ci to use instrumented libc++ Signed-off-by: Dmitri Dolguikh --- ci/do_ci.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/do_ci.sh b/ci/do_ci.sh index d13c7be545bd..384433e2ccf1 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -181,7 +181,7 @@ elif [[ "$CI_TARGET" == "bazel.tsan" ]]; then setup_clang_toolchain echo "bazel TSAN debug build with tests" echo "Building and testing envoy tests ${TEST_TARGETS}" - bazel_with_collection test ${BAZEL_BUILD_OPTIONS} -c dbg --config=clang-tsan --build_tests_only ${TEST_TARGETS} + bazel_with_collection test --config=rbe-toolchain-tsan ${BAZEL_BUILD_OPTIONS} -c dbg --build_tests_only ${TEST_TARGETS} if [ "${ENVOY_BUILD_FILTER_EXAMPLE}" == "1" ]; then echo "Building and testing envoy-filter-example tests..." pushd "${ENVOY_FILTER_EXAMPLE_SRCDIR}" From 1ae6f206146a10ddd65ff06bb77b9fa5b2418281 Mon Sep 17 00:00:00 2001 From: Dmitri Dolguikh Date: Thu, 16 Jul 2020 16:32:06 -0700 Subject: [PATCH 4/4] Trying to fix a race in an fstream access Signed-off-by: Dmitri Dolguikh --- source/common/filesystem/posix/filesystem_impl.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/source/common/filesystem/posix/filesystem_impl.cc b/source/common/filesystem/posix/filesystem_impl.cc index 580e980273a9..e24814d0ca70 100644 --- a/source/common/filesystem/posix/filesystem_impl.cc +++ b/source/common/filesystem/posix/filesystem_impl.cc @@ -96,8 +96,6 @@ std::string InstanceImplPosix::fileReadToEnd(const std::string& path) { throw EnvoyException(absl::StrCat("Invalid path: ", path)); } - std::ios::sync_with_stdio(false); - std::ifstream file(path); if (file.fail()) { throw EnvoyException(absl::StrCat("unable to read file: ", path));