summaryrefslogtreecommitdiff
path: root/src/mongo/stdx/sigaltstack_location_test.cpp
diff options
context:
space:
mode:
authorRyan Egesdahl <ryan.egesdahl@mongodb.com>2020-06-04 16:06:42 -0700
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-06-11 15:56:47 +0000
commitc7115a2c310b1645f6268007e3d458300dab6b54 (patch)
tree139caff20d6e7f2b2253b812e760beff442a8cc0 /src/mongo/stdx/sigaltstack_location_test.cpp
parent0f707044926e0cec422294520f9e42d777818b1f (diff)
downloadmongo-c7115a2c310b1645f6268007e3d458300dab6b54.tar.gz
SERVER-48597 Fix stack trace unit tests with TSAN
Stack trace unit tests were failing with TSAN due to the mechanisms and assumptions of the tests. In one case, we simulate a real failure and do some thread necromancy to recover from it, which was causing TSAN to segfault immediately. In another two, we rely on a feature that makes some assumptions about which threads are running and what signals they can receive, which TSAN's internal threads violate. These tests and features are disabled with TSAN for now so we can run further tests with TSAN. Separately, one of the tests was failing with a complaint from TSAN that errno was being stomped on. That is also addressed.
Diffstat (limited to 'src/mongo/stdx/sigaltstack_location_test.cpp')
-rw-r--r--src/mongo/stdx/sigaltstack_location_test.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mongo/stdx/sigaltstack_location_test.cpp b/src/mongo/stdx/sigaltstack_location_test.cpp
index f6e37b94cc2..bfc0aba4393 100644
--- a/src/mongo/stdx/sigaltstack_location_test.cpp
+++ b/src/mongo/stdx/sigaltstack_location_test.cpp
@@ -256,8 +256,13 @@ int runTests() {
int (*func)();
} static constexpr kTests[] = {
{"stackLocationTest", &stackLocationTest},
-// These tests violate the memory space deliberately, so they generate false positives from ASAN.
-#if !__has_feature(address_sanitizer)
+// These tests violate the memory space deliberately, so they generate false
+// positives from ASAN. TSAN also fails because we rescue a thread from a
+// SIGSEGV due to intentional thread exhaustion with creative use of a longjmp.
+// TSAN is more clever than we want here and intercepts the SIGSEGV before we
+// can do the thread necromancy that lets us verify it died for the right reasons
+// without killing the test harness.
+#if !__has_feature(address_sanitizer) && !__has_feature(thread_sanitizer)
{"recursionTest", &recursionTest},
{"recursionDeathTest", &recursionDeathTest},
#endif