linux command will be deadlock when linked with libasan


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/


echo “done”

Stack information:

(gdb) bt

#0 0x0000ffffb244ecd8 in pthread_rwlock_wrlock () from /lib64/

#1 0x0000ffffb279501c in textdomain () from /lib64/

#2 0x0000ffffb29f72a0 in __interceptor_textdomain (domainname=0x40cab8 “procps-ng”) at …/lib/asan/…/sanitizer_common/

#3 0x0000000000402b10 in main ()

(gdb) info threads

Id Target Id Frame

  • 1 Thread 0xffffb2126480 (LWP 25205) “ps” 0x0000ffffb279501c in textdomain () from /lib64/

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