Skip to content

Commit 550cb76

Browse files
committed
Revert "[LSAN] Fix pthread_create interceptor to ignore leaks in real pthread_create."
This reverts commit a7db3cb.
1 parent 401dee4 commit 550cb76

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

compiler-rt/lib/hwasan/hwasan_interceptors.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,11 @@ static void *HwasanThreadStartFunc(void *arg) {
4040
INTERCEPTOR(int, pthread_create, void *th, void *attr, void *(*callback)(void*),
4141
void * param) {
4242
EnsureMainThreadIDIsCorrect();
43-
ScopedTaggingDisabler tagging_disabler;
43+
ScopedTaggingDisabler disabler;
4444
ThreadStartArg *A = reinterpret_cast<ThreadStartArg *> (MmapOrDie(
4545
GetPageSizeCached(), "pthread_create"));
4646
*A = {callback, param};
47-
int res;
48-
{
49-
// ASAN uses the same approach to disable leaks from pthread_create.
50-
# if CAN_SANITIZE_LEAKS
51-
__lsan::ScopedInterceptorDisabler lsan_disabler;
52-
# endif
53-
res = REAL(pthread_create)(th, attr, &HwasanThreadStartFunc, A);
54-
}
47+
int res = REAL(pthread_create)(th, attr, &HwasanThreadStartFunc, A);
5548
return res;
5649
}
5750

compiler-rt/test/lsan/TestCases/Linux/disabler_in_tsd_destructor.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// RUN: %clang_lsan %s -o %t
33
// RUN: %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=0:use_tls=1:use_ld_allocations=0" %run %t
44

5+
// Fixme: remove once test passes with hwasan
6+
// UNSUPPORTED: hwasan
7+
58
#include <assert.h>
69
#include <pthread.h>
710
#include <stdio.h>

compiler-rt/test/lsan/TestCases/high_allocator_contention.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// Usage: ./a.out number_of_threads total_number_of_allocations
33
// RUN: %clangxx_lsan %s -o %t
44
// RUN: %env_lsan_opts=use_ld_allocations=0 %run %t 5 1000000 2>&1
5+
6+
// Fixme: remove once test passes with hwasan
7+
// UNSUPPORTED: hwasan
58
#include <assert.h>
69
#include <pthread.h>
710
#include <stdlib.h>

compiler-rt/test/lsan/TestCases/leak_check_before_thread_started.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
// RUN: %clangxx_lsan %s -o %t
44
// RUN: %env_lsan_opts="log_pointers=1:log_threads=1" %run %t
55

6+
// Fixme: remove once test passes with hwasan
7+
// UNSUPPORTED: hwasan
8+
69
#include <assert.h>
710
#include <pthread.h>
811
#include <stdio.h>

0 commit comments

Comments
 (0)