INTERCEPTOR(int, pthread_create, void *th, void *attr, void *(*callback)(void*),
void * param) {
EnsureMainThreadIDIsCorrect();
- ScopedTaggingDisabler disabler;
+ ScopedTaggingDisabler tagging_disabler;
ThreadStartArg *A = reinterpret_cast<ThreadStartArg *> (MmapOrDie(
GetPageSizeCached(), "pthread_create"));
*A = {callback, param};
- int res = REAL(pthread_create)(th, attr, &HwasanThreadStartFunc, A);
+ int res;
+ {
+ // ASAN uses the same approach to disable leaks from pthread_create.
+# if CAN_SANITIZE_LEAKS
+ __lsan::ScopedInterceptorDisabler lsan_disabler;
+# endif
+ res = REAL(pthread_create)(th, attr, &HwasanThreadStartFunc, A);
+ }
return res;
}
// Usage: ./a.out number_of_threads total_number_of_allocations
// RUN: %clangxx_lsan %s -o %t
// RUN: %env_lsan_opts=use_ld_allocations=0 %run %t 5 1000000 2>&1
-
-// Fixme: remove once test passes with hwasan
-// UNSUPPORTED: hwasan
#include <assert.h>
#include <pthread.h>
#include <stdlib.h>