Commit 99177311 authored by Jim Meyering's avatar Jim Meyering Committed by Facebook Github Bot 7

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
parent a49866e6
...@@ -572,6 +572,12 @@ TEST(ThreadLocal, Fork2) { ...@@ -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) { TEST(ThreadLocal, SharedLibrary) {
auto exe = fs::executable_path(); auto exe = fs::executable_path();
auto lib = exe.parent_path() / "lib_thread_local_test.so"; auto lib = exe.parent_path() / "lib_thread_local_test.so";
...@@ -613,6 +619,8 @@ TEST(ThreadLocal, SharedLibrary) { ...@@ -613,6 +619,8 @@ TEST(ThreadLocal, SharedLibrary) {
t2.join(); t2.join();
} }
#endif
namespace folly { namespace threadlocal_detail { namespace folly { namespace threadlocal_detail {
struct PthreadKeyUnregisterTester { struct PthreadKeyUnregisterTester {
PthreadKeyUnregister p; PthreadKeyUnregister p;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment