diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2016-01-16 00:57:25 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2016-01-16 00:57:25 +0000 |
commit | 5ae106268eb3099c79114ba306a5bf33d36bd32b (patch) | |
tree | 03bc1da15fceb24c7ee288e0892871117cbdd75b /test/lsan | |
parent | 4198b77a82619d06267267bc8944a47ef1db9fbe (diff) |
[LSan] Ignore all allocations made inside pthread_create.
Thread stack/TLS may be stored by libpthread for future reuse after
thread destruction, and the linked list it's stored in doesn't
even hold valid pointers to the objects, the latter are calculated
by obscure pointer arithmetic.
With this change applied, LSan test suite passes with
"use_ld_allocations" flag defaulted to "false". It still requires more
testing to check if the default can be switched.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257975 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/lsan')
-rw-r--r-- | test/lsan/TestCases/disabler_in_tsd_destructor.c | 2 | ||||
-rw-r--r-- | test/lsan/TestCases/high_allocator_contention.cc | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/test/lsan/TestCases/disabler_in_tsd_destructor.c b/test/lsan/TestCases/disabler_in_tsd_destructor.c index 982fb899e..4a3a7ac14 100644 --- a/test/lsan/TestCases/disabler_in_tsd_destructor.c +++ b/test/lsan/TestCases/disabler_in_tsd_destructor.c @@ -1,5 +1,5 @@ // Regression test. Disabler should not depend on TSD validity. -// RUN: LSAN_BASE="report_objects=1:use_registers=0:use_stacks=0:use_globals=0:use_tls=1" +// RUN: LSAN_BASE="report_objects=1:use_registers=0:use_stacks=0:use_globals=0:use_tls=1:use_ld_allocations=0" // RUN: %clang_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE %run %t diff --git a/test/lsan/TestCases/high_allocator_contention.cc b/test/lsan/TestCases/high_allocator_contention.cc index 2543897bc..f423fd48c 100644 --- a/test/lsan/TestCases/high_allocator_contention.cc +++ b/test/lsan/TestCases/high_allocator_contention.cc @@ -1,7 +1,8 @@ // A benchmark that executes malloc/free pairs in parallel. // Usage: ./a.out number_of_threads total_number_of_allocations +// RUN: LSAN_BASE="use_ld_allocations=0" // RUN: %clangxx_lsan %s -o %t -// RUN: %run %t 5 1000000 2>&1 +// RUN: LSAN_OPTIONS=$LSAN_BASE %run %t 5 1000000 2>&1 #include <assert.h> #include <pthread.h> #include <stdlib.h> |