[compiler-rt] r293610 - [lsan] Renable LSan for x86 Linux

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 3 15:08:28 PST 2017


Thank you! My buildbot is back to green now. :-)

--Artem

On Fri, Feb 3, 2017 at 4:10 AM, Maxim Ostapenko <chefmax7 at gmail.com> wrote:

> On 02/02/17 21:27, Kostya Serebryany wrote:
>
>>
>>
>> On Thu, Feb 2, 2017 at 12:55 AM, Maxim Ostapenko via llvm-commits <
>> llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>> wrote:
>>
>>     Hi,
>>
>>     On 02/02/17 01:53, Artem Belevich via llvm-commits wrote:
>>
>>         Hi,
>>
>>         After this change
>>         SanitizerCommon-lsan-i386-Linux::sem_init_glibc.cc has been
>>         consistently failing on my build bot:
>>         http://lab.llvm.org:8011/builders/clang-cuda-build/builds/4293
>>         <http://lab.llvm.org:8011/builders/clang-cuda-build/builds/4293>
>>
>>         Any ideas what's wrong? It's an Ubuntu 16.04 x64 box, tests
>>         are run on Release+asserts build of clang.
>>
>>
>>     I looked at the test and it seems that it relies on sanitizer
>>     common interceptor to pick the oldest version of sem_init function
>>     from Glibc.
>>     But LSan actually doesn't intercept sem_init, thus the new
>>     implementation is called. This can be observed via gdb:
>>
>>     a.out:
>>     /home/max/src/llvm/projects/compiler-rt/test/sanitizer_commo
>> n/TestCases/Linux/sem_init_glibc.cc:52:
>>     int main(): Assertion `GET_SEM_VALUE(a) == 42' failed.
>>
>>     Program received signal SIGABRT, Aborted.
>>     0xf7fda440 in __kernel_vsyscall ()
>>     (gdb) bt
>>     #0  0xf7fda440 in __kernel_vsyscall ()
>>     #1  0xf7cde570 in raise () from
>>     /home/max/install/glibc-2.24-32bit/lib/libc.so.6
>>     #2  0xf7cdfbc6 in abort () from
>>     /home/max/install/glibc-2.24-32bit/lib/libc.so.6
>>     #3  0xf7cd7787 in __assert_fail_base () from
>>     /home/max/install/glibc-2.24-32bit/lib/libc.so.6
>>     #4  0xf7cd7837 in __assert_fail () from
>>     /home/max/install/glibc-2.24-32bit/lib/libc.so.6
>>     #5  0x0806ebc9 in main () at
>>     /home/max/src/llvm/projects/compiler-rt/test/sanitizer_commo
>> n/TestCases/Linux/sem_init_glibc.cc:52
>>     (gdb) frame 5
>>     #5  0x0806ebc9 in main () at
>>     /home/max/src/llvm/projects/compiler-rt/test/sanitizer_commo
>> n/TestCases/Linux/sem_init_glibc.cc:52
>>     52      assert(GET_SEM_VALUE(a) == 42);
>>     (gdb) p a
>>     $1 = 84
>>
>>     Thus I see 2 options how to get rid of this failure:
>>     1) Disable the test on LSan x86
>>
>>
>> let's start from 1) and filling a bug for 2)
>>
>
> Done via r294001. I'll open a bug a bit later.
>
> -Maxim
>
>     2) Check Glibc version at runtime and adjust corresponding
>>     GET_SEM_VALUE(V) accordingly.
>>
>>     -Maxim
>>
>>
>>         --Artem
>>
>>
>>         On Mon, Jan 30, 2017 at 11:15 PM, Maxim Ostapenko via
>>         llvm-commits <llvm-commits at lists.llvm.org
>>         <mailto:llvm-commits at lists.llvm.org>
>>         <mailto:llvm-commits at lists.llvm.org
>>         <mailto:llvm-commits at lists.llvm.org>>> wrote:
>>
>>             Author: chefmax
>>             Date: Tue Jan 31 01:15:37 2017
>>             New Revision: 293610
>>
>>             URL:
>>         http://llvm.org/viewvc/llvm-project?rev=293610&view=rev
>>         <http://llvm.org/viewvc/llvm-project?rev=293610&view=rev>
>>             <http://llvm.org/viewvc/llvm-project?rev=293610&view=rev
>>         <http://llvm.org/viewvc/llvm-project?rev=293610&view=rev>>
>>             Log:
>>             [lsan] Renable LSan for x86 Linux
>>
>>             The missed clang part was committed at
>>         https://reviews.llvm.org/rL293609
>>         <https://reviews.llvm.org/rL293609>
>>             <https://reviews.llvm.org/rL293609
>>         <https://reviews.llvm.org/rL293609>> thus
>>             we can reenable LSan for x86 Linux.
>>
>>             Differential Revision: https://reviews.llvm.org/D28609
>>         <https://reviews.llvm.org/D28609>
>>             <https://reviews.llvm.org/D28609
>>         <https://reviews.llvm.org/D28609>>
>>
>>             Modified:
>>                 compiler-rt/trunk/cmake/config-ix.cmake
>>                 compiler-rt/trunk/lib/lsan/lsan_allocator.cc
>>                 compiler-rt/trunk/lib/lsan/lsan_common.h
>>                 compiler-rt/trunk/lib/lsan/lsan_interceptors.cc
>>                 compiler-rt/trunk/lib/sanitize
>> r_common/sanitizer_flags.inc
>>                 compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
>>                 compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.h
>>                           compiler-rt/trunk/lib/sanitize
>> r_common/sanitizer_stoptheworld_linux_libcdep.cc
>>                 compiler-rt/trunk/test/asan/lit.cfg
>>                 compiler-rt/trunk/test/lsan/TestCases/disabler.cc
>>                        compiler-rt/trunk/test/lsan/T
>> estCases/do_leak_check_override.cc
>>                        compiler-rt/trunk/test/lsan/T
>> estCases/high_allocator_contention.cc
>>                        compiler-rt/trunk/test/lsan/T
>> estCases/large_allocation_leak.cc
>>                        compiler-rt/trunk/test/lsan/T
>> estCases/leak_check_at_exit.cc
>>                 compiler-rt/trunk/test/lsan/TestCases/link_turned_off.cc
>>                 compiler-rt/trunk/test/lsan/TestCases/pointer_to_self.cc
>>                        compiler-rt/trunk/test/lsan/T
>> estCases/print_suppressions.cc
>>                        compiler-rt/trunk/test/lsan/T
>> estCases/recoverable_leak_check.cc
>>                        compiler-rt/trunk/test/lsan/T
>> estCases/register_root_region.cc
>>                 compiler-rt/trunk/test/lsan/TestCases/stale_stack_leak.cc
>>                        compiler-rt/trunk/test/lsan/T
>> estCases/suppressions_default.cc
>>                 compiler-rt/trunk/test/lsan/Te
>> stCases/suppressions_file.cc
>>                 compiler-rt/trunk/test/lsan/TestCases/use_after_return.cc
>>                        compiler-rt/trunk/test/lsan/T
>> estCases/use_globals_initialized.cc
>>                        compiler-rt/trunk/test/lsan/T
>> estCases/use_globals_uninitialized.cc
>>                 compiler-rt/trunk/test/lsan/Te
>> stCases/use_poisoned_asan.cc
>>                 compiler-rt/trunk/test/lsan/TestCases/use_registers.cc
>>                 compiler-rt/trunk/test/lsan/TestCases/use_stacks.cc
>>                        compiler-rt/trunk/test/lsan/T
>> estCases/use_stacks_threaded.cc
>>                 compiler-rt/trunk/test/lsan/TestCases/use_tls_dynamic.cc
>>                           compiler-rt/trunk/test/lsan/Te
>> stCases/use_tls_pthread_specific_dynamic.cc
>>                           compiler-rt/trunk/test/lsan/Te
>> stCases/use_tls_pthread_specific_static.cc
>>                 compiler-rt/trunk/test/lsan/TestCases/use_tls_static.cc
>>                 compiler-rt/trunk/test/lsan/TestCases/use_unaligned.cc
>>                           compiler-rt/trunk/test/sanitiz
>> er_common/TestCases/Posix/sanitizer_set_death_callback_test.cc
>>                        compiler-rt/trunk/test/saniti
>> zer_common/TestCases/corelimit.cc
>>                 compiler-rt/trunk/test/sanitizer_common/lit.common.cfg
>>                 compiler-rt/trunk/test/sanitizer_common/print_address.h
>>
>>             Modified: compiler-rt/trunk/cmake/config-ix.cmake
>>             URL:
>>         http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/
>> config-ix.cmake?rev=293610&r1=293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake
>> /config-ix.cmake?rev=293610&r1=293609&r2=293610&view=diff>
>>                    <http://llvm.org/viewvc/llvm-
>> project/compiler-rt/trunk/cmake/config-ix.cmake?rev=293610&
>> r1=293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake
>> /config-ix.cmake?rev=293610&r1=293609&r2=293610&view=diff>>
>>                    =============================
>> =================================================
>>             --- compiler-rt/trunk/cmake/config-ix.cmake (original)
>>             +++ compiler-rt/trunk/cmake/config-ix.cmake Tue Jan 31
>>         01:15:37 2017
>>             @@ -164,7 +164,7 @@ set(ALL_SANITIZER_COMMON_SUPPORTED_ARCH
>>              set(ALL_ASAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32}
>>         ${ARM64}
>>                  ${MIPS32} ${MIPS64} ${PPC64} ${S390X})
>>              set(ALL_DFSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64})
>>             -set(ALL_LSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64})
>>             +set(ALL_LSAN_SUPPORTED_ARCH ${X86} ${X86_64} ${MIPS64}
>>         ${ARM64})
>>              set(ALL_MSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64}
>>         ${PPC64})
>>              set(ALL_PROFILE_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32}
>>         ${ARM64}
>>             ${PPC64}
>>                  ${MIPS32} ${MIPS64} ${S390X})
>>
>>             Modified: compiler-rt/trunk/lib/lsan/lsan_allocator.cc
>>             URL:
>>         http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/ls
>> an/lsan_allocator.cc?rev=293610&r1=293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/l
>> san/lsan_allocator.cc?rev=293610&r1=293609&r2=293610&view=diff>
>>                    <http://llvm.org/viewvc/llvm-
>> project/compiler-rt/trunk/lib/lsan/lsan_allocator.cc?rev=293
>> 610&r1=293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/l
>> san/lsan_allocator.cc?rev=293610&r1=293609&r2=293610&view=diff>>
>>                    =============================
>> =================================================
>>             --- compiler-rt/trunk/lib/lsan/lsan_allocator.cc (original)
>>             +++ compiler-rt/trunk/lib/lsan/lsan_allocator.cc Tue Jan 31
>>             01:15:37 2017
>>             @@ -28,12 +28,21 @@ namespace __lsan {
>>              struct ChunkMetadata {
>>                u8 allocated : 8;  // Must be first.
>>                ChunkTag tag : 2;
>>             +#if SANITIZER_WORDSIZE == 64
>>                uptr requested_size : 54;
>>             +#else
>>             +  uptr requested_size : 32;
>>             +  uptr padding : 22;
>>             +#endif
>>                u32 stack_trace_id;
>>              };
>>
>>             -#if defined(__mips64) || defined(__aarch64__)
>>             +#if defined(__mips64) || defined(__aarch64__) ||
>>         defined(__i386__)
>>             +#if defined(__i386__)
>>             +static const uptr kMaxAllowedMallocSize = 1UL << 30;
>>             +#else
>>              static const uptr kMaxAllowedMallocSize = 4UL << 30;
>>             +#endif
>>              static const uptr kRegionSizeLog = 20;
>>              static const uptr kNumRegions = SANITIZER_MMAP_RANGE_SIZE >>
>>             kRegionSizeLog;
>>              typedef TwoLevelByteMap<(kNumRegions >> 12), 1 << 12>
>>         ByteMap;
>>
>>             Modified: compiler-rt/trunk/lib/lsan/lsan_common.h
>>             URL:
>>         http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/ls
>> an/lsan_common.h?rev=293610&r1=293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/l
>> san/lsan_common.h?rev=293610&r1=293609&r2=293610&view=diff>
>>                    <http://llvm.org/viewvc/llvm-
>> project/compiler-rt/trunk/lib/lsan/lsan_common.h?rev=293610&
>> r1=293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/l
>> san/lsan_common.h?rev=293610&r1=293609&r2=293610&view=diff>>
>>                    =============================
>> =================================================
>>             --- compiler-rt/trunk/lib/lsan/lsan_common.h (original)
>>             +++ compiler-rt/trunk/lib/lsan/lsan_common.h Tue Jan 31
>>         01:15:37 2017
>>             @@ -22,9 +22,19 @@
>>              #include "sanitizer_common/sanitizer_stoptheworld.h"
>>              #include "sanitizer_common/sanitizer_symbolizer.h"
>>
>>             +// LeakSanitizer relies on some Glibc's internals (e.g. TLS
>>             machinery) thus
>>             +// supported for Linux only. Also, LSan doesn't like 32 bit
>>             architectures
>>             +// because of "small" (4 bytes) pointer size that leads
>>         to high
>>             false negative
>>             +// ratio on large leaks. But we still want to have it for
>>         some 32
>>             bit arches
>>             +// (e.g. x86), see
>>         https://github.com/google/sanitizers/issues/403
>>         <https://github.com/google/sanitizers/issues/403>
>>             <https://github.com/google/sanitizers/issues/403
>>         <https://github.com/google/sanitizers/issues/403>>.
>>             +// To enable LeakSanitizer on new architecture, one need
>>         to implement
>>             +// internal_clone function as well as (probably) adjust TLS
>>             machinery for
>>             +// new architecture inside sanitizer library.
>>              #if (SANITIZER_LINUX && !SANITIZER_ANDROID) &&
>>             (SANITIZER_WORDSIZE == 64) \
>>                   && (defined(__x86_64__) || defined(__mips64) ||
>>     defined(__aarch64__))
>>              #define CAN_SANITIZE_LEAKS 1
>>             +#elif SANITIZER_LINUX && !SANITIZER_ANDROID &&
>>         defined(__i386__)
>>             +#define CAN_SANITIZE_LEAKS 1
>>              #else
>>              #define CAN_SANITIZE_LEAKS 0
>>              #endif
>>
>>             Modified: compiler-rt/trunk/lib/lsan/lsan_interceptors.cc
>>             URL:
>>         http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/ls
>> an/lsan_interceptors.cc?rev=293610&r1=293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/l
>> san/lsan_interceptors.cc?rev=293610&r1=293609&r2=293610&view=diff>
>>                    <http://llvm.org/viewvc/llvm-
>> project/compiler-rt/trunk/lib/lsan/lsan_interceptors.cc?rev=
>> 293610&r1=293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/l
>> san/lsan_interceptors.cc?rev=293610&r1=293609&r2=293610&view=diff>>
>>                    =============================
>> =================================================
>>             --- compiler-rt/trunk/lib/lsan/lsan_interceptors.cc
>> (original)
>>             +++ compiler-rt/trunk/lib/lsan/lsan_interceptors.cc Tue Jan
>> 31
>>             01:15:37 2017
>>             @@ -27,6 +27,8 @@
>>              #include "lsan_common.h"
>>              #include "lsan_thread.h"
>>
>>             +#include <stddef.h>
>>             +
>>              using namespace __lsan;
>>
>>              extern "C" {
>>             @@ -186,13 +188,13 @@ INTERCEPTOR(void, cfree, void *p) ALIAS(
>>                return Allocate(stack, size, 1, kAlwaysClearMemory);
>>
>>              INTERCEPTOR_ATTRIBUTE
>>             -void *operator new(uptr size) { OPERATOR_NEW_BODY; }
>>             +void *operator new(size_t size) { OPERATOR_NEW_BODY; }
>>              INTERCEPTOR_ATTRIBUTE
>>             -void *operator new[](uptr size) { OPERATOR_NEW_BODY; }
>>             +void *operator new[](size_t size) { OPERATOR_NEW_BODY; }
>>              INTERCEPTOR_ATTRIBUTE
>>             -void *operator new(uptr size, std::nothrow_t const&) {
>>             OPERATOR_NEW_BODY; }
>>             +void *operator new(size_t size, std::nothrow_t const&) {
>>             OPERATOR_NEW_BODY; }
>>              INTERCEPTOR_ATTRIBUTE
>>             -void *operator new[](uptr size, std::nothrow_t const&) {
>>             OPERATOR_NEW_BODY; }
>>             +void *operator new[](size_t size, std::nothrow_t const&) {
>>             OPERATOR_NEW_BODY; }
>>
>>              #define OPERATOR_DELETE_BODY \
>>                ENSURE_LSAN_INITED;        \
>>
>>             Modified:
>>         compiler-rt/trunk/lib/sanitizer_common/sanitizer_flags.inc
>>             URL:
>>         http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sa
>> nitizer_common/sanitizer_flags.inc?rev=293610&r1=293609&r2=
>> 293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/s
>> anitizer_common/sanitizer_flags.inc?rev=293610&r1=293609&r2=
>> 293610&view=diff>
>>                    <http://llvm.org/viewvc/llvm-
>> project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_fla
>> gs.inc?rev=293610&r1=293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/s
>> anitizer_common/sanitizer_flags.inc?rev=293610&r1=293609&r2=
>> 293610&view=diff>>
>>                    =============================
>> =================================================
>>             --- compiler-rt/trunk/lib/sanitize
>> r_common/sanitizer_flags.inc
>>             (original)
>>             +++
>>         compiler-rt/trunk/lib/sanitizer_common/sanitizer_flags.inc Tue
>>             Jan 31 01:15:37 2017
>>             @@ -62,7 +62,8 @@ COMMON_FLAG(
>>              COMMON_FLAG(
>>                  int, verbosity, 0,
>>                  "Verbosity level (0 - silent, 1 - a bit of output, 2+
>>         - more
>>             output).")
>>             -COMMON_FLAG(bool, detect_leaks, true, "Enable memory leak
>>             detection.")
>>             +COMMON_FLAG(bool, detect_leaks, SANITIZER_WORDSIZE == 64,
>>             +            "Enable memory leak detection.")
>>              COMMON_FLAG(
>>                  bool, leak_check_at_exit, true,
>>                  "Invoke leak checking in an atexit handler. Has no
>>         effect if "
>>
>>             Modified:
>>         compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
>>             URL:
>>         http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sa
>> nitizer_common/sanitizer_linux.cc?rev=293610&r1=293609&r2=
>> 293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/s
>> anitizer_common/sanitizer_linux.cc?rev=293610&r1=293609&r2=
>> 293610&view=diff>
>>                    <http://llvm.org/viewvc/llvm-
>> project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_lin
>> ux.cc?rev=293610&r1=293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/s
>> anitizer_common/sanitizer_linux.cc?rev=293610&r1=293609&r2=
>> 293610&view=diff>>
>>                    =============================
>> =================================================
>>             --- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
>>             (original)
>>             +++
>>         compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc Tue
>>             Jan 31 01:15:37 2017
>>             @@ -1175,6 +1175,71 @@ uptr internal_clone(int (*fn)(void
>>         *), v
>>                             "r0", "r29", "r27", "r28");
>>                return res;
>>              }
>>             +#elif defined(__i386__) && SANITIZER_LINUX
>>             +uptr internal_clone(int (*fn)(void *), void *child_stack, int
>>             flags, void *arg,
>>             +                    int *parent_tidptr, void *newtls, int
>>             *child_tidptr) {
>>             +  int res;
>>             +  if (!fn || !child_stack)
>>             +    return -EINVAL;
>>             +  CHECK_EQ(0, (uptr)child_stack % 16);
>>             +  child_stack = (char *)child_stack - 7 * sizeof(unsigned
>>         int);
>>             +  ((unsigned int *)child_stack)[0] = (uptr)flags;
>>             +  ((unsigned int *)child_stack)[1] = (uptr)0;
>>             +  ((unsigned int *)child_stack)[2] = (uptr)fn;
>>             +  ((unsigned int *)child_stack)[3] = (uptr)arg;
>>             +  __asm__ __volatile__(
>>             +                       /* %eax = syscall(%eax =
>>         SYSCALL(clone),
>>             +                        *                %ebx = flags,
>>             +                        *                %ecx = child_stack,
>>             +                        *                %edx =
>>         parent_tidptr,
>>             +                        *                %esi  = new_tls,
>>             +                        *                %edi = child_tidptr)
>>             +                        */
>>             +
>>             +                        /* Obtain flags */
>>             +                        "movl    (%%ecx), %%ebx\n"
>>             +                        /* Do the system call */
>>             +                        "pushl   %%ebx\n"
>>             +                        "pushl   %%esi\n"
>>             +                        "pushl   %%edi\n"
>>             +                        /* Remember the flag value.  */
>>             +                        "movl    %%ebx, (%%ecx)\n"
>>             +                        "int     $0x80\n"
>>             +                        "popl    %%edi\n"
>>             +                        "popl    %%esi\n"
>>             +                        "popl    %%ebx\n"
>>             +
>>             +                        /* if (%eax != 0)
>>             +                         *   return;
>>             +                         */
>>             +
>>             +                        "test    %%eax,%%eax\n"
>>             +                        "jnz    1f\n"
>>             +
>>             +                        /* terminate the stack frame */
>>             +                        "xorl   %%ebp,%%ebp\n"
>>             +                        /* Call FN. */
>>             +                        "call    *%%ebx\n"
>>             +#ifdef PIC
>>             +                        "call    here\n"
>>             +                        "here:\n"
>>             +                        "popl    %%ebx\n"
>>             +                        "addl
>>         $_GLOBAL_OFFSET_TABLE_+[.-here],
>>             %%ebx\n"
>>             +#endif
>>             +                        /* Call exit */
>>             +                        "movl    %%eax, %%ebx\n"
>>             +                        "movl    %2, %%eax\n"
>>             +                        "int     $0x80\n"
>>             +                        "1:\n"
>>             +                       : "=a" (res)
>>             +                       : "a"(SYSCALL(clone)),
>>         "i"(SYSCALL(exit)),
>>             +                         "c"(child_stack),
>>             +                         "d"(parent_tidptr),
>>             +                         "S"(newtls),
>>             +                         "D"(child_tidptr)
>>             +                       : "memory");
>>             +  return res;
>>             +}
>>              #endif  // defined(__x86_64__) && SANITIZER_LINUX
>>
>>              #if SANITIZER_ANDROID
>>
>>             Modified:
>>         compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.h
>>             URL:
>>         http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sa
>> nitizer_common/sanitizer_linux.h?rev=293610&r1=293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/s
>> anitizer_common/sanitizer_linux.h?rev=293610&r1=293609&r2=
>> 293610&view=diff>
>>                    <http://llvm.org/viewvc/llvm-
>> project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_lin
>> ux.h?rev=293610&r1=293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/s
>> anitizer_common/sanitizer_linux.h?rev=293610&r1=293609&r2=
>> 293610&view=diff>>
>>                    =============================
>> =================================================
>>             --- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.h
>>             (original)
>>             +++
>>         compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.h Tue
>>             Jan 31 01:15:37 2017
>>             @@ -48,7 +48,7 @@ int internal_sigaction_syscall(int signu
>>              #endif
>>              void internal_sigdelset(__sanitizer_sigset_t *set, int
>>         signum);
>>              #if defined(__x86_64__) || defined(__mips__) ||
>>             defined(__aarch64__) \
>>             -  || defined(__powerpc64__) || defined(__s390__)
>>             +  || defined(__powerpc64__) || defined(__s390__) ||
>>         defined(__i386__)
>>              uptr internal_clone(int (*fn)(void *), void *child_stack, int
>>             flags, void *arg,
>>                                  int *parent_tidptr, void *newtls, int
>>             *child_tidptr);
>>              #endif
>>
>>             Modified:
>>                    compiler-rt/trunk/lib/sanitiz
>> er_common/sanitizer_stoptheworld_linux_libcdep.cc
>>             URL:
>>         http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sa
>> nitizer_common/sanitizer_stoptheworld_linux_libcdep.cc?rev=
>> 293610&r1=293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/s
>> anitizer_common/sanitizer_stoptheworld_linux_libcdep.cc?rev=
>> 293610&r1=293609&r2=293610&view=diff>
>>                    <http://llvm.org/viewvc/llvm-
>> project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_sto
>> ptheworld_linux_libcdep.cc?rev=293610&r1=293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/s
>> anitizer_common/sanitizer_stoptheworld_linux_libcdep.cc?rev=
>> 293610&r1=293609&r2=293610&view=diff>>
>>                    =============================
>> =================================================
>>             ---
>>                    compiler-rt/trunk/lib/sanitiz
>> er_common/sanitizer_stoptheworld_linux_libcdep.cc
>>             (original)
>>             +++
>>                    compiler-rt/trunk/lib/sanitiz
>> er_common/sanitizer_stoptheworld_linux_libcdep.cc
>>             Tue Jan 31 01:15:37 2017
>>             @@ -16,7 +16,7 @@
>>
>>              #if SANITIZER_LINUX && (defined(__x86_64__) ||
>>         defined(__mips__) || \
>>                                      defined(__aarch64__) ||
>>             defined(__powerpc64__) || \
>>             -                        defined(__s390__))
>>             +                        defined(__s390__) ||
>>         defined(__i386__))
>>
>>              #include "sanitizer_stoptheworld.h"
>>
>>             @@ -528,4 +528,4 @@ uptr SuspendedThreadsList::RegisterCount
>>
>>              #endif  // SANITIZER_LINUX && (defined(__x86_64__) ||
>>             defined(__mips__)
>>                      // || defined(__aarch64__) || defined(__powerpc64__)
>>             -        // || defined(__s390__)
>>             +        // || defined(__s390__) || defined(__i386__)
>>
>>             Modified: compiler-rt/trunk/test/asan/lit.cfg
>>             URL:
>>         http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/
>> asan/lit.cfg?rev=293610&r1=293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/
>> asan/lit.cfg?rev=293610&r1=293609&r2=293610&view=diff>
>>                    <http://llvm.org/viewvc/llvm-
>> project/compiler-rt/trunk/test/asan/lit.cfg?rev=293610&r1=
>> 293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/
>> asan/lit.cfg?rev=293610&r1=293609&r2=293610&view=diff>>
>>                    =============================
>> =================================================
>>             --- compiler-rt/trunk/test/asan/lit.cfg (original)
>>             +++ compiler-rt/trunk/test/asan/lit.cfg Tue Jan 31
>>         01:15:37 2017
>>             @@ -205,7 +205,7 @@ if config.target_arch != 'arm' and confi
>>                config.available_features.add('stable-runtime')
>>
>>              # Turn on leak detection on 64-bit Linux.
>>             -if config.host_os == 'Linux' and config.target_arch ==
>>         'x86_64':
>>             +if config.host_os == 'Linux' and (config.target_arch ==
>>         'x86_64'
>>             or config.target_arch == 'i386'):
>>                config.available_features.add('leak-detection')
>>
>>              # Set LD_LIBRARY_PATH to pick dynamic runtime up properly.
>>
>>             Modified: compiler-rt/trunk/test/lsan/TestCases/disabler.cc
>>             URL:
>>         http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/
>> lsan/TestCases/disabler.cc?rev=293610&r1=293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/
>> lsan/TestCases/disabler.cc?rev=293610&r1=293609&r2=293610&view=diff>
>>                    <http://llvm.org/viewvc/llvm-
>> project/compiler-rt/trunk/test/lsan/TestCases/disabler.cc?
>> rev=293610&r1=293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/
>> lsan/TestCases/disabler.cc?rev=293610&r1=293609&r2=293610&view=diff>>
>>                    =============================
>> =================================================
>>             --- compiler-rt/trunk/test/lsan/TestCases/disabler.cc
>>         (original)
>>             +++ compiler-rt/trunk/test/lsan/TestCases/disabler.cc Tue
>>         Jan 31
>>             01:15:37 2017
>>             @@ -1,5 +1,5 @@
>>              // Test for ScopedDisabler.
>>             -// RUN:
>>                    LSAN_BASE="report_objects=1:u
>> se_registers=0:use_stacks=0:use_globals=0:use_tls=0"
>>             +// RUN:
>>                    LSAN_BASE="detect_leaks=1:rep
>> ort_objects=1:use_registers=0:use_stacks=0:use_globals=0:use_tls=0"
>>              // RUN: %clangxx_lsan %s -o %t
>>              // RUN: LSAN_OPTIONS=$LSAN_BASE not %run %t 2>&1 |
>>         FileCheck %s
>>
>>
>>             Modified:
>>                    compiler-rt/trunk/test/lsan/T
>> estCases/do_leak_check_override.cc
>>             URL:
>>         http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/
>> lsan/TestCases/do_leak_check_override.cc?rev=293610&r1=
>> 293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/
>> lsan/TestCases/do_leak_check_override.cc?rev=293610&r1=
>> 293609&r2=293610&view=diff>
>>                    <http://llvm.org/viewvc/llvm-
>> project/compiler-rt/trunk/test/lsan/TestCases/do_leak_check_
>> override.cc?rev=293610&r1=293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/
>> lsan/TestCases/do_leak_check_override.cc?rev=293610&r1=
>> 293609&r2=293610&view=diff>>
>>                    =============================
>> =================================================
>>             ---
>>                    compiler-rt/trunk/test/lsan/T
>> estCases/do_leak_check_override.cc
>>             (original)
>>             +++
>>                    compiler-rt/trunk/test/lsan/T
>> estCases/do_leak_check_override.cc
>>             Tue Jan 31 01:15:37 2017
>>             @@ -1,7 +1,7 @@
>>              // Test for __lsan_do_leak_check(). We test it by making
>>         the leak
>>             check run
>>              // before global destructors, which also tests
>>         compatibility with
>>             HeapChecker's
>>              // "normal" mode (LSan runs in "strict" mode by default).
>>             -// RUN: LSAN_BASE="use_stacks=0:use_registers=0"
>>             +// RUN:
>>         LSAN_BASE="detect_leaks=1:use_stacks=0:use_registers=0"
>>              // RUN: %clangxx_lsan %s -o %t
>>              // RUN: LSAN_OPTIONS=$LSAN_BASE not %run %t 2>&1 | FileCheck
>>             --check-prefix=CHECK-strict %s
>>              // RUN: LSAN_OPTIONS=$LSAN_BASE not %run %t foo 2>&1 |
>>         FileCheck
>>             --check-prefix=CHECK-normal %s
>>
>>             Modified:
>>                    compiler-rt/trunk/test/lsan/T
>> estCases/high_allocator_contention.cc
>>             URL:
>>         http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/
>> lsan/TestCases/high_allocator_contention.cc?rev=293610&r1=
>> 293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/
>> lsan/TestCases/high_allocator_contention.cc?rev=293610&r1=
>> 293609&r2=293610&view=diff>
>>                    <http://llvm.org/viewvc/llvm-
>> project/compiler-rt/trunk/test/lsan/TestCases/high_allocator
>> _contention.cc?rev=293610&r1=293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/
>> lsan/TestCases/high_allocator_contention.cc?rev=293610&r1=
>> 293609&r2=293610&view=diff>>
>>                    =============================
>> =================================================
>>             ---
>>                    compiler-rt/trunk/test/lsan/T
>> estCases/high_allocator_contention.cc
>>             (original)
>>             +++
>>                    compiler-rt/trunk/test/lsan/T
>> estCases/high_allocator_contention.cc
>>             Tue Jan 31 01:15:37 2017
>>             @@ -1,6 +1,6 @@
>>              // 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: LSAN_BASE="detect_leaks=1:use_ld_allocations=0"
>>              // RUN: %clangxx_lsan %s -o %t
>>              // RUN: LSAN_OPTIONS=$LSAN_BASE %run %t 5 1000000 2>&1
>>              #include <assert.h>
>>
>>             Modified:
>>             compiler-rt/trunk/test/lsan/TestCases/large_allocation_leak.
>> cc
>>             URL:
>>         http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/
>> lsan/TestCases/large_allocation_leak.cc?rev=293610&r1=
>> 293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/
>> lsan/TestCases/large_allocation_leak.cc?rev=293610&r1=
>> 293609&r2=293610&view=diff>
>>                    <http://llvm.org/viewvc/llvm-
>> project/compiler-rt/trunk/test/lsan/TestCases/large_allocati
>> on_leak.cc?rev=293610&r1=293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/
>> lsan/TestCases/large_allocation_leak.cc?rev=293610&r1=
>> 293609&r2=293610&view=diff>>
>>                    =============================
>> =================================================
>>             ---
>>         compiler-rt/trunk/test/lsan/TestCases/large_allocation_leak.cc
>>             (original)
>>             +++
>>         compiler-rt/trunk/test/lsan/TestCases/large_allocation_leak.cc
>>             Tue Jan 31 01:15:37 2017
>>             @@ -1,8 +1,12 @@
>>              // Test that LargeMmapAllocator's chunks aren't reachable via
>>             some internal data structure.
>>             -// RUN:
>>         LSAN_BASE="report_objects=1:use_stacks=0:use_registers=0"
>>             +// RUN:
>>                    LSAN_BASE="detect_leaks=1:rep
>> ort_objects=1:use_stacks=0:use_registers=0"
>>              // RUN: %clangxx_lsan %s -o %t
>>              // RUN: LSAN_OPTIONS=$LSAN_BASE not %run %t 2>&1 |
>>         FileCheck %s
>>
>>             +// For 32 bit LSan it's pretty likely that large chunks are
>>             "reachable" from some
>>             +// internal data structures (e.g. Glibc global data).
>>             +// UNSUPPORTED: x86
>>             +
>>              #include <stdio.h>
>>              #include <stdlib.h>
>>              #include "sanitizer_common/print_address.h"
>>
>>             Modified:
>>         compiler-rt/trunk/test/lsan/TestCases/leak_check_at_exit.cc
>>             URL:
>>         http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/
>> lsan/TestCases/leak_check_at_exit.cc?rev=293610&r1=293609&
>> r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/
>> lsan/TestCases/leak_check_at_exit.cc?rev=293610&r1=293609&
>> r2=293610&view=diff>
>>                    <http://llvm.org/viewvc/llvm-
>> project/compiler-rt/trunk/test/lsan/TestCases/leak_check_at_
>> exit.cc?rev=293610&r1=293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/
>> lsan/TestCases/leak_check_at_exit.cc?rev=293610&r1=293609&
>> r2=293610&view=diff>>
>>                    =============================
>> =================================================
>>             ---
>>         compiler-rt/trunk/test/lsan/TestCases/leak_check_at_exit.cc
>>             (original)
>>             +++
>>         compiler-rt/trunk/test/lsan/TestCases/leak_check_at_exit.cc
>>             Tue Jan 31 01:15:37 2017
>>             @@ -1,5 +1,5 @@
>>              // Test for the leak_check_at_exit flag.
>>             -// RUN: LSAN_BASE="use_stacks=0:use_registers=0"
>>             +// RUN:
>>         LSAN_BASE="detect_leaks=1:use_stacks=0:use_registers=0"
>>              // RUN: %clangxx_lsan %s -o %t
>>              // RUN: LSAN_OPTIONS=$LSAN_BASE not %run %t foo 2>&1 |
>>         FileCheck
>>             %s --check-prefix=CHECK-do
>>              // RUN: LSAN_OPTIONS=$LSAN_BASE not %run %t 2>&1 |
>>         FileCheck %s
>>             --check-prefix=CHECK-do
>>
>>             Modified:
>>         compiler-rt/trunk/test/lsan/TestCases/link_turned_off.cc
>>             URL:
>>         http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/
>> lsan/TestCases/link_turned_off.cc?rev=293610&r1=293609&
>> r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/
>> lsan/TestCases/link_turned_off.cc?rev=293610&r1=293609&
>> r2=293610&view=diff>
>>                    <http://llvm.org/viewvc/llvm-
>> project/compiler-rt/trunk/test/lsan/TestCases/link_turned_
>> off.cc?rev=293610&r1=293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/
>> lsan/TestCases/link_turned_off.cc?rev=293610&r1=293609&
>> r2=293610&view=diff>>
>>                    =============================
>> =================================================
>>             --- compiler-rt/trunk/test/lsan/TestCases/link_turned_off.cc
>>             (original)
>>             +++
>>         compiler-rt/trunk/test/lsan/TestCases/link_turned_off.cc Tue
>>             Jan 31 01:15:37 2017
>>             @@ -1,5 +1,5 @@
>>              // Test for disabling LSan at link-time.
>>             -// RUN: LSAN_BASE="use_stacks=0:use_registers=0"
>>             +// RUN:
>>         LSAN_BASE="detect_leaks=1:use_stacks=0:use_registers=0"
>>              // RUN: %clangxx_lsan %s -o %t
>>              // RUN: LSAN_OPTIONS=$LSAN_BASE %run %t
>>              // RUN: LSAN_OPTIONS=$LSAN_BASE not %run %t foo 2>&1 |
>>         FileCheck %s
>>
>>             Modified:
>>         compiler-rt/trunk/test/lsan/TestCases/pointer_to_self.cc
>>             URL:
>>         http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/
>> lsan/TestCases/pointer_to_self.cc?rev=293610&r1=293609&
>> r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/
>> lsan/TestCases/pointer_to_self.cc?rev=293610&r1=293609&
>> r2=293610&view=diff>
>>                    <http://llvm.org/viewvc/llvm-
>> project/compiler-rt/trunk/test/lsan/TestCases/pointer_to_
>> self.cc?rev=293610&r1=293609&r2=293610&view=diff
>>         <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/
>> lsan/TestCases/pointer_to_self.cc?rev=293610&r1=293609&
>> r2=293610&view=diff>>
>
>


-- 
--Artem Belevich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170203/e737bdb9/attachment-0001.html>


More information about the llvm-commits mailing list