Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 74c8891

Browse files
Revert "[lldb] Fix TSan report on Linux (#179115)"
This reverts commit cc72920. This patch causes two tests to unexpectedly pass: 1. lldb-api.functionalities/tsan/cpp_global_location/TestTsanCPPGlobalLocation.py 2. lldb-api.functionalities/tsan/global_location/TestTsanGlobalLocation.py Reverting to fix premerge. Not fixing forward so someone who is familiar with LLDB can take a look and make sure those tests now should pass.
1 parent 80677dc commit 74c8891

3 files changed

Lines changed: 10 additions & 14 deletions

File tree

lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,8 @@ extern "C"
8888
// TODO: dlsym won't work on Windows.
8989
void *dlsym(void* handle, const char* symbol);
9090
int (*ptr__tsan_get_report_loc_object_type)(void *report, unsigned long idx, const char **object_type);
91-
)"
92-
// clang-format off
93-
#if defined(__linux__)
94-
R"(
95-
void *const RTLD_DEFAULT = (void *)0;
96-
}
97-
)";
98-
#else
99-
R"(
100-
void *const RTLD_DEFAULT = (void *)-2;
101-
}
91+
}
10292
)";
103-
#endif
104-
// clang-format on
10593

10694
const char *thread_sanitizer_retrieve_report_data_command = R"(
10795
@@ -173,7 +161,7 @@ struct {
173161
} unique_tids[REPORT_ARRAY_SIZE];
174162
} t = {0};
175163
176-
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");
164+
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");
177165
178166
t.report = __tsan_get_current_report();
179167
__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);

lldb/test/API/functionalities/tsan/thread_leak/TestTsanThreadLeak.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99

1010

1111
class TsanThreadLeakTestCase(TestBase):
12+
@expectedFailureAll(
13+
oslist=["linux"],
14+
bugnumber="non-core functionality, need to reenable and fix later (DES 2014.11.07)",
15+
)
1216
@expectedFailureNetBSD
1317
@skipIfFreeBSD # llvm.org/pr21136 runtimes not yet available by default
1418
@skipIfRemote

lldb/test/API/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010

1111

1212
class TsanThreadNumbersTestCase(TestBase):
13+
@expectedFailureAll(
14+
oslist=["linux"],
15+
bugnumber="non-core functionality, need to reenable and fix later (DES 2014.11.07)",
16+
)
1317
@expectedFailureNetBSD
1418
@skipIfFreeBSD # llvm.org/pr21136 runtimes not yet available by default
1519
@skipIfRemote

0 commit comments

Comments
 (0)