[llvm-dev] Intermittent lsan failure on aarch64-linux

Vitaly Buka via llvm-dev llvm-dev at lists.llvm.org
Thu May 13 22:44:44 PDT 2021


Probably sched_yield() clobbered x13. Can you disassemble your glibc
version?

Can you try change the test to
asm("mov x13, %0\n"
      "mov x14, %0\n"
      "mov x15, %0"
      :
      : "r"(p));

It should be fine to store value in additional registers just in case.



On Thu, 13 May 2021 at 11:45, Adhemerval Zanella via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hi all,
>
> I am investigating an intermittent failure on aarch64 linux bots related to
> asan, where the use_registers.cpp sometimes fails.  I tried to check if it
> some related issue on the test itself, but it does seems to do what the
> code is trying to simulate (an thread with store the address of a leaked
> allocation on the stack thread).
>
> Instrumenting the code to dump some log (log_pointers=1:log_threads=1) the
> following below (I omitted my local paths).  It seems that on some runs
> 'use_registers=1' is really working as intended.
>
> Any idea? It started to show when we moved ours buildbots to newer ubuntu
> 20.04 (with has a recent glibc 2.31), but I am not sure it is a glibc
> related issue.
>
> ---
>
> FAIL: LeakSanitizer-Standalone-aarch64 :: TestCases/use_registers.cpp (289
> of 80810)
> ******************** TEST 'LeakSanitizer-Standalone-aarch64 ::
> TestCases/use_registers.cpp' FAILED ********************
> Script:
> --
> : 'RUN: at line 2';
>  LSAN_BASE="report_objects=1:use_stacks=0:log_pointers=1:log_threads=1"
> : 'RUN: at line 3';      <build_path>/bin/clang  --driver-mode=g++ -O0
>  -gline-tables-only -fsanitize=leak -I<src_path>/compiler-rt/test/lsan/../
> -pthread <src_path>/compiler-rt/test/lsan/TestCases/use_registers.cpp -o
> <build_path>/projects/compiler-rt/test/lsan/AARCH64LsanConfig/TestCases/Output/use_registers.cpp.tmp
> : 'RUN: at line 4';   env
> LSAN_OPTIONS=:detect_leaks=1:$LSAN_BASE:"use_registers=0" not
> <build_path>/projects/compiler-rt/test/lsan/AARCH64LsanConfig/TestCases/Output/use_registers.cpp.tmp
> 2>&1 | FileCheck
> <src_path>/compiler-rt/test/lsan/TestCases/use_registers.cpp
> : 'RUN: at line 5';   env
> LSAN_OPTIONS=:detect_leaks=1:$LSAN_BASE:"use_registers=1"
> <build_path>/projects/compiler-rt/test/lsan/AARCH64LsanConfig/TestCases/Output/use_registers.cpp.tmp
> 2>&1
> : 'RUN: at line 6';   env LSAN_OPTIONS=:detect_leaks=1:""
> <build_path>/projects/compiler-rt/test/lsan/AARCH64LsanConfig/TestCases/Output/use_registers.cpp.tmp
> 2>&1
> --
> Exit Code: 23
>
> Command Output (stdout):
> --
> Test alloc: 0xffff7d503600
> ==342105==Ignored: chunk 0xffff7db03e80-0xffff7db03fb0 of size 304.
> ==342105==Scanning GLOBAL range 0x0000004516f0-0x000000d25e80.
> ==342105==Scanning GLOBAL range 0x000000da6f00-0x000000da90d8.
> ==342105==Scanning GLOBAL range 0xffff7fe507d8-0xffff7fe606b0.
> ==342105==0xffff7fe5d3e8: found 0xffff7e500000 pointing into chunk
> 0xffff7e500000-0xffff7e511c00 of size 72704.
> ==342105==Scanning GLOBAL range 0xffff7fc7cd58-0xffff7fc7d078.
> ==342105==Scanning GLOBAL range 0xffff7fbcbbf8-0xffff7fbd03e8.
> ==342105==Scanning GLOBAL range 0xffff7fb9fd60-0xffff7fba0330.
> ==342105==Scanning GLOBAL range 0xffff7fb87d48-0xffff7fb88100.
> ==342105==Scanning GLOBAL range 0xffff7fb73db8-0xffff7fb74458.
> ==342105==Scanning GLOBAL range 0xffff7fb478b8-0xffff7fb4fc50.
> ==342105==Scanning GLOBAL range 0xffff7fe92590-0xffff7fe94200.
> ==342105==Processing thread 342082.
> ==342105==Scanning REGISTERS range 0xffff7f875000-0xffff7f875110.
> ==342105==TLS at 0xffff7f9cd030-0xffff7f9db6b0.
> ==342105==Scanning TLS range 0xffff7f9cd030-0xffff7f9cd760.
> ==342105==Scanning TLS range 0xffff7f9daf80-0xffff7f9db6b0.
> ==342105==Processing thread 342099.
> ==342105==Scanning REGISTERS range 0xffff7f875000-0xffff7f875110.
> ==342105==TLS at 0xffff7e4f1980-0xffff7e500000.
> ==342105==Scanning TLS range 0xffff7e4f1980-0xffff7e4f20b0.
> ==342105==Scanning TLS range 0xffff7e4ff8d0-0xffff7e500000.
> ==342105==Scanning HEAP range 0xffff7e500000-0xffff7e511c00.
> ==342105==Scanning HEAP range 0xffff7db03e80-0xffff7db03fb0.
> ==342105==Processing platform-specific allocations.
> ==342105==Scanning leaked chunks.
> ==342105==Scanning HEAP range 0xffff7d503600-0xffff7d503b39.
> ==342105==Scanning HEAP range 0xffff7db03e80-0xffff7db03fb0.
>
> =================================================================
> ==342082==ERROR: LeakSanitizer: detected memory leaks
>
> Direct leak of 1337 byte(s) in 1 object(s) allocated from:
>     #0 0x42bc20 in malloc
> <src_path>/compiler-rt/lib/lsan/lsan_interceptors.cpp:56:3
>     #1 0x42dbf8 in registers_thread_func
> <src_path>/compiler-rt/test/lsan/TestCases/use_registers.cpp:17:13
>     #2 0xffff7fba94f8 in start_thread
> /build/glibc-iW00TY/glibc-2.31/nptl/pthread_create.c:477:8
>     #3 0xffff7fab1678
> /build/glibc-iW00TY/glibc-2.31/misc/../sysdeps/unix/sysv/linux/aarch64/clone.S:78
>
> Objects leaked above:
> 0xffff7d503600 (1337 bytes)
>
> SUMMARY: LeakSanitizer: 1337 byte(s) leaked in 1 allocation(s).
>
> --
>
> ********************
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210513/556830e5/attachment.html>


More information about the llvm-dev mailing list