[llvm-dev] linux command will be deadlock when linked with libasan
Haishan via llvm-dev
llvm-dev at lists.llvm.org
Tue Feb 23 20:27:46 PST 2021
Hello,
centos seems to be incompatible with libasan(8.0.1).
Run a linux command(like ps,free) with LD_PRELOAD envrionable variable on centos aarch64 kunpeng920 (gcc-9.2, glibc-2.30),
It will locked.
Run scripts:
export ASAN_OPTIONS=detect_leaks=0:halt_on_error=0
export LD_LIBRARY_PATH=/usr/lib64/clang/8.0.1/lib/
export LD_PRELOAD=/lib64/clang/8.0.1/lib/libclang_rt.asan-aarch64.so
ps
echo "done"
Stack information:
(gdb) bt
#0 0x0000ffffb244ecd8 in pthread_rwlock_wrlock () from /lib64/libpthread.so.0
#1 0x0000ffffb279501c in textdomain () from /lib64/libc.so.6
#2 0x0000ffffb29f72a0 in __interceptor_textdomain (domainname=0x40cab8 "procps-ng") at ../lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:413
#3 0x0000000000402b10 in main ()
(gdb) info threads
Id Target Id Frame
* 1 Thread 0xffffb2126480 (LWP 25205) "ps" 0x0000ffffb279501c in textdomain () from /lib64/libc.so.6
There is only one thread. how could it generate deadlock?
But unset LD_PRELOAD, ps runs ok.
Try update compiler-rt to 10.0.0, this deadlock still exists.
Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210224/c20cb876/attachment.html>
More information about the llvm-dev
mailing list