https://github.com/DrSergei updated https://github.com/llvm/llvm-project/pull/181004
>From d058f538349f79ecb1cebf8faf6ed40c468cb2d8 Mon Sep 17 00:00:00 2001 From: Sergei Druzhkov <[email protected]> Date: Tue, 10 Feb 2026 20:46:49 +0300 Subject: [PATCH 1/2] Reland "[lldb] Fix TSan report" --- .../TSan/InstrumentationRuntimeTSan.cpp | 14 ++++++++++++-- .../TestTsanCPPGlobalLocation.py | 4 ---- .../tsan/global_location/TestTsanGlobalLocation.py | 4 ---- .../tsan/multiple/TestTsanMultiple.py | 4 ---- .../tsan/thread_leak/TestTsanThreadLeak.py | 4 ---- .../tsan/thread_numbers/TestTsanThreadNumbers.py | 4 ---- 6 files changed, 12 insertions(+), 22 deletions(-) diff --git a/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp b/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp index 04dd825519d35..2dff1674a629a 100644 --- a/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp +++ b/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp @@ -88,8 +88,18 @@ extern "C" // TODO: dlsym won't work on Windows. void *dlsym(void* handle, const char* symbol); int (*ptr__tsan_get_report_loc_object_type)(void *report, unsigned long idx, const char **object_type); -} +)" +#if defined(__linux__) + R"( + void *const RTLD_DEFAULT = (void *)0; + } +)"; +#else + R"( + void *const RTLD_DEFAULT = (void *)-2; + } )"; +#endif const char *thread_sanitizer_retrieve_report_data_command = R"( @@ -161,7 +171,7 @@ struct { } unique_tids[REPORT_ARRAY_SIZE]; } t = {0}; -ptr__tsan_get_report_loc_object_type = (typeof(ptr__tsan_get_report_loc_object_type))(void *)dlsym((void*)-2 /*RTLD_DEFAULT*/, "__tsan_get_report_loc_object_type"); +ptr__tsan_get_report_loc_object_type = (typeof(ptr__tsan_get_report_loc_object_type))(void *)dlsym(RTLD_DEFAULT, "__tsan_get_report_loc_object_type"); t.report = __tsan_get_current_report(); __tsan_get_report_data(t.report, &t.description, &t.report_count, &t.stack_count, &t.mop_count, &t.loc_count, &t.mutex_count, &t.thread_count, &t.unique_tid_count, t.sleep_trace, REPORT_TRACE_SIZE); diff --git a/lldb/test/API/functionalities/tsan/cpp_global_location/TestTsanCPPGlobalLocation.py b/lldb/test/API/functionalities/tsan/cpp_global_location/TestTsanCPPGlobalLocation.py index ed65f68c1551c..356e09d33fa08 100644 --- a/lldb/test/API/functionalities/tsan/cpp_global_location/TestTsanCPPGlobalLocation.py +++ b/lldb/test/API/functionalities/tsan/cpp_global_location/TestTsanCPPGlobalLocation.py @@ -10,10 +10,6 @@ class TsanCPPGlobalLocationTestCase(TestBase): - @expectedFailureAll( - oslist=["linux"], - bugnumber="non-core functionality, need to reenable and fix later (DES 2014.11.07)", - ) @expectedFailureNetBSD @skipIfFreeBSD # llvm.org/pr21136 runtimes not yet available by default @skipIfRemote diff --git a/lldb/test/API/functionalities/tsan/global_location/TestTsanGlobalLocation.py b/lldb/test/API/functionalities/tsan/global_location/TestTsanGlobalLocation.py index 6fced5bae752a..1c02785977922 100644 --- a/lldb/test/API/functionalities/tsan/global_location/TestTsanGlobalLocation.py +++ b/lldb/test/API/functionalities/tsan/global_location/TestTsanGlobalLocation.py @@ -10,10 +10,6 @@ class TsanGlobalLocationTestCase(TestBase): - @expectedFailureAll( - oslist=["linux"], - bugnumber="non-core functionality, need to reenable and fix later (DES 2014.11.07)", - ) @expectedFailureNetBSD @skipIfFreeBSD # llvm.org/pr21136 runtimes not yet available by default @skipIfRemote diff --git a/lldb/test/API/functionalities/tsan/multiple/TestTsanMultiple.py b/lldb/test/API/functionalities/tsan/multiple/TestTsanMultiple.py index aa2d1d9feadc0..d73157603018d 100644 --- a/lldb/test/API/functionalities/tsan/multiple/TestTsanMultiple.py +++ b/lldb/test/API/functionalities/tsan/multiple/TestTsanMultiple.py @@ -10,10 +10,6 @@ class TsanMultipleTestCase(TestBase): - @expectedFailureAll( - oslist=["linux"], - bugnumber="non-core functionality, need to reenable and fix later (DES 2014.11.07)", - ) @expectedFailureNetBSD @skipIfFreeBSD # llvm.org/pr21136 runtimes not yet available by default @skipIfRemote diff --git a/lldb/test/API/functionalities/tsan/thread_leak/TestTsanThreadLeak.py b/lldb/test/API/functionalities/tsan/thread_leak/TestTsanThreadLeak.py index 2f5cceb7873c7..fe995935ea4ef 100644 --- a/lldb/test/API/functionalities/tsan/thread_leak/TestTsanThreadLeak.py +++ b/lldb/test/API/functionalities/tsan/thread_leak/TestTsanThreadLeak.py @@ -9,10 +9,6 @@ class TsanThreadLeakTestCase(TestBase): - @expectedFailureAll( - oslist=["linux"], - bugnumber="non-core functionality, need to reenable and fix later (DES 2014.11.07)", - ) @expectedFailureNetBSD @skipIfFreeBSD # llvm.org/pr21136 runtimes not yet available by default @skipIfRemote diff --git a/lldb/test/API/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py b/lldb/test/API/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py index 8fc1ae64c267e..68e9a064793bb 100644 --- a/lldb/test/API/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py +++ b/lldb/test/API/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py @@ -10,10 +10,6 @@ class TsanThreadNumbersTestCase(TestBase): - @expectedFailureAll( - oslist=["linux"], - bugnumber="non-core functionality, need to reenable and fix later (DES 2014.11.07)", - ) @expectedFailureNetBSD @skipIfFreeBSD # llvm.org/pr21136 runtimes not yet available by default @skipIfRemote >From 564a0e6d7064bbe0ef692dc8cfc9583fe6eb5566 Mon Sep 17 00:00:00 2001 From: Sergei Druzhkov <[email protected]> Date: Fri, 13 Feb 2026 16:34:28 +0300 Subject: [PATCH 2/2] Move macros --- .../TSan/InstrumentationRuntimeTSan.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp b/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp index 2dff1674a629a..74bd3ca25bc6f 100644 --- a/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp +++ b/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp @@ -88,18 +88,13 @@ extern "C" // TODO: dlsym won't work on Windows. void *dlsym(void* handle, const char* symbol); int (*ptr__tsan_get_report_loc_object_type)(void *report, unsigned long idx, const char **object_type); -)" #if defined(__linux__) - R"( - void *const RTLD_DEFAULT = (void *)0; - } -)"; +#define RTLD_DEFAULT ((void *) 0) #else - R"( - void *const RTLD_DEFAULT = (void *)-2; +#define RTLD_DEFAULT ((void *) -2) +#endif } )"; -#endif const char *thread_sanitizer_retrieve_report_data_command = R"( _______________________________________________ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
