I am seeing something like this while testing the 6.0.0 release on ARM, AArch64 and x86: FAIL: AddressSanitizer-aarch64-linux-dynamic :: TestCases/Linux/asan_rt_confict_test-1.cc (3574 of 47777) ******************** TEST 'AddressSanitizer-aarch64-linux-dynamic :: TestCases/Linux/asan_rt_confict_test-1.cc' FAILED ******************** Script: -- /home/tcwg-buildslave/workspace/tcwg-llvm-release/tcwg-apm_64-build/rc1/Phase3/Release/llvmCore-6.0.0-rc1.obj/./bin/clang --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only /home/tcwg-buildslave/workspace/tcwg-llvm-release/tcwg-apm_64-build/rc1/llvm.src/projects/compiler-rt/test/asan/TestCases/Linux/asan_rt_confict_test-1.cc -o /home/tcwg-buildslave/workspace/tcwg-llvm-release/tcwg-apm_64-build/rc1/Phase3/Release/llvmCore-6.0.0-rc1.obj/projects/compiler-rt/test/asan/AARCH64LinuxDynamicConfig/TestCases/Linux/Output/asan_rt_confict_test-1.cc.tmp env LD_PRELOAD=libclang_rt.asan-aarch64.so not /home/tcwg-buildslave/workspace/tcwg-llvm-release/tcwg-apm_64-build/rc1/Phase3/Release/llvmCore-6.0.0-rc1.obj/projects/compiler-rt/test/asan/AARCH64LinuxDynamicConfig/TestCases/Linux/Output/asan_rt_confict_test-1.cc.tmp 2>&1 | FileCheck /home/tcwg-buildslave/workspace/tcwg-llvm-release/tcwg-apm_64-build/rc1/llvm.src/projects/compiler-rt/test/asan/TestCases/Linux/asan_rt_confict_test-1.cc -- Exit Code: 1 Command Output (stderr): -- /home/tcwg-buildslave/workspace/tcwg-llvm-release/tcwg-apm_64-build/rc1/llvm.src/projects/compiler-rt/test/asan/TestCases/Linux/asan_rt_confict_test-1.cc:13:11: error: expected string not found in input // CHECK: Your application is linked against incompatible ASan runtimes ^ <stdin>:1:1: note: scanning from here Error: Segmentation fault (core dumped) ^ <stdin>:1:3: note: possible intended match here Error: Segmentation fault (core dumped) ^
+eugenis maybe
After moving to my new Debian-based workstation, I get similar errors. When testing the branch with: $ utils/release/test-release.sh -svn-path branches/release_60 -triple x86_64-unknown-linux-gnu I get the two errors below. For some reason I don't get it during regular builds. I also don't know how to debug this, really :-/ FAIL: AddressSanitizer-i386-linux-dynamic :: TestCases/Linux/asan_rt_confict_test-1.cc (4030 of 50225) ******************** TEST 'AddressSanitizer-i386-linux-dynamic :: TestCases/Linux/asan_rt_confict_test-1.cc' FAILED ******************** Script: -- /work/llvm-release-test/branches_release_60/Phase3/Release/llvmCore-test-branches_release_60.obj/./bin/clang --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m32 /work/llvm-release-test/branches_release_60/llvm.src/projects/compiler-rt/test/asan/TestCases/Linux/asan_rt_confict_test-1.cc -o /work/llvm-release-test/branches_release_60/Phase3/Release/llvmCore-test-branches_release_60.obj/projects/compiler-rt/test/asan/I386LinuxDynamicConfig/TestCases/Linux/Output/asan_rt_confict_test-1.cc.tmp env LD_PRELOAD=libclang_rt.asan-i386.so not /work/llvm-release-test/branches_release_60/Phase3/Release/llvmCore-test-branches_release_60.obj/projects/compiler-rt/test/asan/I386LinuxDynamicConfig/TestCases/Linux/Output/asan_rt_confict_test-1.cc.tmp 2>&1 | FileCheck /work/llvm-release-test/branches_release_60/llvm.src/projects/compiler-rt/test/asan/TestCases/Linux/asan_rt_confict_test-1.cc -- Exit Code: 1 Command Output (stderr): -- /work/llvm-release-test/branches_release_60/llvm.src/projects/compiler-rt/test/asan/TestCases/Linux/asan_rt_confict_test-1.cc:13:11: error: expected string not found in input // CHECK: Your application is linked against incompatible ASan runtimes ^ <stdin>:1:1: note: scanning from here ERROR: ld.so: object 'libclang_rt.asan-i386.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. ^ <stdin>:2:1: note: possible intended match here Error: Segmentation fault ^ -- ******************** Testing: 0 .. FAIL: AddressSanitizer-x86_64-linux-dynamic :: TestCases/Linux/asan_rt_confict_test-1.cc (4876 of 50225) ******************** TEST 'AddressSanitizer-x86_64-linux-dynamic :: TestCases/Linux/asan_rt_confict_test-1.cc' FAILED ******************** Script: -- /work/llvm-release-test/branches_release_60/Phase3/Release/llvmCore-test-branches_release_60.obj/./bin/clang --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m64 /work/llvm-release-test/branches_release_60/llvm.src/projects/compiler-rt/test/asan/TestCases/Linux/asan_rt_confict_test-1.cc -o /work/llvm-release-test/branches_release_60/Phase3/Release/llvmCore-test-branches_release_60.obj/projects/compiler-rt/test/asan/X86_64LinuxDynamicConfig/TestCases/Linux/Output/asan_rt_confict_test-1.cc.tmp env LD_PRELOAD=libclang_rt.asan-x86_64.so not /work/llvm-release-test/branches_release_60/Phase3/Release/llvmCore-test-branches_release_60.obj/projects/compiler-rt/test/asan/X86_64LinuxDynamicConfig/TestCases/Linux/Output/asan_rt_confict_test-1.cc.tmp 2>&1 | FileCheck /work/llvm-release-test/branches_release_60/llvm.src/projects/compiler-rt/test/asan/TestCases/Linux/asan_rt_confict_test-1.cc -- Exit Code: 1 Command Output (stderr): -- /work/llvm-release-test/branches_release_60/llvm.src/projects/compiler-rt/test/asan/TestCases/Linux/asan_rt_confict_test-1.cc:13:11: error: expected string not found in input // CHECK: Your application is linked against incompatible ASan runtimes ^ <stdin>:1:1: note: scanning from here Error: Segmentation fault ^ -- ********************
I don't have the same setup, but... how does this test ever work on multilib systems? // RUN: env LD_PRELOAD=%shared_libasan not %run %t 2>&1 | FileCheck %s "not" is either 32 or 64 bit binary, and the test is run in both variants. One has got to fail.
Ah, that's OK, unlike bionic, glibc loader ignores incompatible LD_PRELOAD. So, I can not reproduce this. A stack trace from the segmentation fault would help a lot.
I reproduced the issue, and it is related to the size of the path of the shared lib. If you copy libclang_rt.asan-i386.so into a directory path which is 113 characters long you will get a segmentation fault and it will work for anything shorter. Notice that it also the case in 5.0 release. Looking quickly into the sanitizers code, it seems that size of filenames are hardcoded and not homogeneous, here in AsanCheckIncompatibleRT() (from asan_linux.cc) it is a 128 char array, in tsan it is 256 and in sanitizer_posix.cc it is 4095
I think that the safest thing to do is to use MAXPATHLEN from <sys/param.h> to be in sync with glibc LD_PRELOAD name limits (value can be 4096 or 1024). Quick test fixes the issue, I'll submit a patch after a full validation.
Proposed fix: https://reviews.llvm.org/D42900
*** Bug 36025 has been marked as a duplicate of this bug. ***
The fix landed in r324496 and I've merged it to 6.0 in r324506. I plan to tag rc2, so let's leave it open for now and close when it's confirmed.
Seems to be gone now, thanks!