From 9917731199d890499d7a732c1573281b4976bb16 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 2 Jul 2016 09:31:28 -0700 Subject: [PATCH] folly:thread_local_test: avoid test failure due to dlopen of *SAN-enabled binary: skip it Summary: The ThreadLocal.SharedLibrary test would fail when compiled with any sanitizer. Skip that test when any sanitizer is enabled. Reviewed By: Mizuchi Differential Revision: D3508099 fbshipit-source-id: 0419269f6454ee4edb93fe00b6f0e79756e609d0 --- folly/test/ThreadLocalTest.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/folly/test/ThreadLocalTest.cpp b/folly/test/ThreadLocalTest.cpp index aaa3794d..7a3dab1d 100644 --- a/folly/test/ThreadLocalTest.cpp +++ b/folly/test/ThreadLocalTest.cpp @@ -572,6 +572,12 @@ TEST(ThreadLocal, Fork2) { } } +// Elide this test when using any sanitizer. Otherwise, the dlopen'ed code +// would end up running without e.g., ASAN-initialized data structures and +// failing right away. +#if !defined FOLLY_SANITIZE_ADDRESS && !defined UNDEFINED_SANITIZER && \ + !defined FOLLY_SANITIZE_THREAD + TEST(ThreadLocal, SharedLibrary) { auto exe = fs::executable_path(); auto lib = exe.parent_path() / "lib_thread_local_test.so"; @@ -613,6 +619,8 @@ TEST(ThreadLocal, SharedLibrary) { t2.join(); } +#endif + namespace folly { namespace threadlocal_detail { struct PthreadKeyUnregisterTester { PthreadKeyUnregister p; -- 2.34.1