This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt] Get rid of "%T" expansions
ClosedPublic

Authored by filcab on Aug 7 2017, 4:09 PM.

Details

Summary

The %T lit expansion expands to a common directory shared between all the tests in the same directory, which is unexpected and unintuitive, and more importantly, it's been a source of subtle race conditions and flaky tests. In https://reviews.llvm.org/D35396, it was agreed that it would be best to simply ban %T and only keep %t, which is unique to each test. When a test needs a temporary directory, it can just create one using mkdir %t.

This patch removes %T in compiler-rt.

Diff Detail

Event Timeline

kubamracek created this revision.Aug 7 2017, 4:09 PM

Patch to remove %T from compiler-rt: https://reviews.llvm.org/D36434

vitalybuka added inline comments.Aug 7 2017, 4:20 PM
test/asan/TestCases/Linux/interception_readdir_r_test.cc
8

TEMP_DIR and binary are the same, does this work?

kubamracek added inline comments.Aug 7 2017, 4:22 PM
test/asan/TestCases/Linux/interception_readdir_r_test.cc
8

Ah, this won't work. Also, would you mind running this patch on Linux to see if there's more failures?

@kubamracek running tests on Linux now.

kubamracek updated this revision to Diff 110117.Aug 7 2017, 5:21 PM

@kubamracek:

ekarpenkov@rad:~/code/llvm/release-build$ ninja check-all
[15/15] Running all regression tests
lit.py: /home/ekarpenkov/code/llvm/utils/lit/lit/discovery.py:224: warning: input '/home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/xray/Unit' contained no tests
lit.py: /home/ekarpenkov/code/llvm/tools/clang/test/lit.cfg:200: note: using clang: '/home/ekarpenkov/code/llvm/release-build/./bin/clang'
lit.py: /home/ekarpenkov/code/llvm/release-build/utils/lit/tests/lit.cfg:61: warning: Could not import psutil. Some tests will be skipped and the --timeout command line argument will not work.
FAIL: Profile-x86_64 :: Linux/coverage_test.cpp (33763 of 34930)
******************** TEST 'Profile-x86_64 :: Linux/coverage_test.cpp' FAILED ********************
Script:
--
/home/ekarpenkov/code/llvm/release-build/./bin/clang -m64 -ldl  -fprofile-instr-generate -fuse-ld=gold -O2 -fdata-sections -ffunction-sections -fcoverage-mapping -Wl,--gc-sections -o /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/coverage_test.cpp.tmp /home/ekarpenkov/code/llvm/projects/compiler-rt/test/profile/Linux/coverage_test.cpp
env LLVM_PROFILE_FILE=/home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/coverage_test.cpp.tmp.profraw  /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/coverage_test.cpp.tmp
llvm-profdata merge -o /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/coverage_test.cpp.tmp.profdata /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/coverage_test.cpp.tmp.profraw
llvm-cov show /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/coverage_test.cpp.tmp -instr-profile /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/coverage_test.cpp.tmp.profdata -filename-equivalence 2>&1 | FileCheck /home/ekarpenkov/code/llvm/projects/compiler-rt/test/profile/Linux/coverage_test.cpp
/home/ekarpenkov/code/llvm/release-build/./bin/clang -m64 -ldl  -fprofile-instr-generate -O2  -fcoverage-mapping  -o /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/coverage_test.cpp.tmp.2 /home/ekarpenkov/code/llvm/projects/compiler-rt/test/profile/Linux/coverage_test.cpp
env LLVM_PROFILE_FILE=/home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/coverage_test.cpp.tmp.2.profraw  /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/coverage_test.cpp.tmp.2
llvm-profdata merge -o /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/coverage_test.cpp.tmp.2.profdata /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/coverage_test.cpp.tmp.2.profraw
llvm-cov show /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/coverage_test.cpp.tmp.2 -instr-profile /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/coverage_test.cpp.tmp.2.profdata -filename-equivalence 2>&1 | FileCheck /home/ekarpenkov/code/llvm/projects/compiler-rt/test/profile/Linux/coverage_test.cpp
/home/ekarpenkov/code/llvm/release-build/./bin/clang -m64 -ldl  -fprofile-instr-generate -O2  -fcoverage-mapping -Wl,--gc-sections -o /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/coverage_test.cpp.tmp.3 /home/ekarpenkov/code/llvm/projects/compiler-rt/test/profile/Linux/coverage_test.cpp
llvm-objdump -h /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/coverage_test.cpp.tmp.3 | FileCheck --check-prefix COVMAP /home/ekarpenkov/code/llvm/projects/compiler-rt/test/profile/Linux/coverage_test.cpp
/home/ekarpenkov/code/llvm/release-build/./bin/clang -m64 -ldl  -fprofile-instr-generate -fuse-ld=gold -O2 -fdata-sections -ffunction-sections -fPIE -pie -fcoverage-mapping -Wl,--gc-sections -o /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/coverage_test.cpp.tmp.pie /home/ekarpenkov/code/llvm/projects/compiler-rt/test/profile/Linux/coverage_test.cpp
env LLVM_PROFILE_FILE=/home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/coverage_test.cpp.tmp.pie.profraw  /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/coverage_test.cpp.tmp.pie
llvm-profdata merge -o /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/coverage_test.cpp.tmp.pie.profdata /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/coverage_test.cpp.tmp.pie.profraw
llvm-cov show /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/coverage_test.cpp.tmp.pie -instr-profile /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/coverage_test.cpp.tmp.pie.profdata -filename-equivalence 2>&1 | FileCheck /home/ekarpenkov/code/llvm/projects/compiler-rt/test/profile/Linux/coverage_test.cpp
--
Exit Code: 1

Command Output (stderr):
--
/home/ekarpenkov/code/llvm/projects/compiler-rt/test/profile/Linux/coverage_test.cpp:22:14: error: expected string not found in input
 } // CHECK: [[@LINE]]| 0| }
             ^
<stdin>:22:21: note: scanning from here
 21| 1| if (cond) { // CHECK: [[@LINE]]| 1| if (cond) {
                    ^
<stdin>:22:21: note: with expression "@LINE" equal to "22"
 21| 1| if (cond) { // CHECK: [[@LINE]]| 1| if (cond) {
                    ^
<stdin>:23:29: note: possible intended match here
 22| 1| } // CHECK: [[@LINE]]| 0| }
                            ^

--

********************
FAIL: Profile-x86_64 :: Linux/extern_template.test (33768 of 34930)
******************** TEST 'Profile-x86_64 :: Linux/extern_template.test' FAILED ********************
Script:
--
/home/ekarpenkov/code/llvm/release-build/./bin/clang -m64 -ldl -O2  -c -o /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/extern_template.test.tmp.0.o /home/ekarpenkov/code/llvm/projects/compiler-rt/test/profile/Linux/../Inputs/extern_template.cpp
/home/ekarpenkov/code/llvm/release-build/./bin/clang -m64 -ldl  -fprofile-instr-generate -O2  -c -o /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/extern_template.test.tmp.o /home/ekarpenkov/code/llvm/projects/compiler-rt/test/profile/Linux/../Inputs/extern_template.cpp
/home/ekarpenkov/code/llvm/release-build/./bin/clang -m64 -ldl  -fprofile-instr-generate -O2 -fcoverage-mapping /home/ekarpenkov/code/llvm/projects/compiler-rt/test/profile/Linux/../Inputs/extern_template1.cpp /home/ekarpenkov/code/llvm/projects/compiler-rt/test/profile/Linux/../Inputs/extern_template2.cpp /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/extern_template.test.tmp.o -o /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/extern_template.test.tmp
env LLVM_PROFILE_FILE=/home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/extern_template.test.tmp.profraw  /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/extern_template.test.tmp
llvm-profdata show --all-functions /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/extern_template.test.tmp.profraw | FileCheck /home/ekarpenkov/code/llvm/projects/compiler-rt/test/profile/Linux/extern_template.test
llvm-profdata merge -o /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/extern_template.test.tmp.profdata /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/extern_template.test.tmp.profraw
llvm-cov show -instr-profile=/home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/extern_template.test.tmp.profdata /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/extern_template.test.tmp | FileCheck /home/ekarpenkov/code/llvm/projects/compiler-rt/test/profile/Linux/../Inputs/extern_template.h
/home/ekarpenkov/code/llvm/release-build/./bin/clang -m64 -ldl  -fprofile-instr-generate -O2 -fcoverage-mapping /home/ekarpenkov/code/llvm/projects/compiler-rt/test/profile/Linux/../Inputs/extern_template1.cpp /home/ekarpenkov/code/llvm/projects/compiler-rt/test/profile/Linux/../Inputs/extern_template2.cpp /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/extern_template.test.tmp.0.o -o /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/extern_template.test.tmp.0
env LLVM_PROFILE_FILE=/home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/extern_template.test.tmp.0.profraw  /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/extern_template.test.tmp.0
llvm-profdata show --all-functions /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/extern_template.test.tmp.0.profraw | FileCheck /home/ekarpenkov/code/llvm/projects/compiler-rt/test/profile/Linux/extern_template.test
llvm-profdata merge -o /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/extern_template.test.tmp.0.profdata /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/extern_template.test.tmp.0.profraw
llvm-cov show -instr-profile=/home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/extern_template.test.tmp.0.profdata /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64/Linux/Output/extern_template.test.tmp.0 | FileCheck /home/ekarpenkov/code/llvm/projects/compiler-rt/test/profile/Linux/../Inputs/extern_template.h
--
Exit Code: 1

Command Output (stderr):
--
clang-6.0: warning: -ldl: 'linker' input unused [-Wunused-command-line-argument]
clang-6.0: warning: -ldl: 'linker' input unused [-Wunused-command-line-argument]
/home/ekarpenkov/code/llvm/projects/compiler-rt/test/profile/Linux/../Inputs/extern_template.h:6:19: error: expected string not found in input
 } else // CHECK: [[@LINE]]| 1| } else
                  ^
<stdin>:6:16: note: scanning from here
 5| 1| M += 2; // CHECK: [[@LINE]]| 1| M += 2;
               ^
<stdin>:6:16: note: with expression "@LINE" equal to "6"
 5| 1| M += 2; // CHECK: [[@LINE]]| 1| M += 2;
               ^
<stdin>:7:33: note: possible intended match here
 6| 2| } else // CHECK: [[@LINE]]| 1| } else
                                ^

--

********************
FAIL: ThreadSanitizer-x86_64 :: ignore_lib1.cc (34467 of 34930)
******************** TEST 'ThreadSanitizer-x86_64 :: ignore_lib1.cc' FAILED ********************
Script:
--
rm -rf /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib1.cc.tmp-dir
mkdir /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib1.cc.tmp-dir
/home/ekarpenkov/code/llvm/release-build/./bin/clang --driver-mode=g++ -fsanitize=thread -Wall -m64 -gline-tables-only -I/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/../ -std=c++11 -I/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/../ -O1 /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib1.cc -DLIB -fPIC -fno-sanitize=thread -shared -o /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib1.cc.tmp-dir/libignore_lib1.so
/home/ekarpenkov/code/llvm/release-build/./bin/clang --driver-mode=g++ -fsanitize=thread -Wall -m64 -gline-tables-only -I/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/../ -std=c++11 -I/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/../ -O1 /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib1.cc -o /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib1.cc.tmp
echo running w/o suppressions:
/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/deflake.bash  /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib1.cc.tmp | FileCheck /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib1.cc --check-prefix=CHECK-NOSUPP
echo running with suppressions:
env TSAN_OPTIONS=atexit_sleep_ms=0:suppressions='/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib1.cc.supp'  /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib1.cc.tmp 2>&1 | FileCheck /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib1.cc --check-prefix=CHECK-WITHSUPP
--
Exit Code: 1

Command Output (stdout):
--
running w/o suppressions:

--
Command Output (stderr):
--
/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib1.cc:45:18: error: expected string not found in input
// CHECK-NOSUPP: WARNING: ThreadSanitizer: data race
                 ^
<stdin>:1:1: note: scanning from here
failed to load the library (12)
^
<stdin>:1:8: note: possible intended match here
failed to load the library (12)
       ^

--

********************
FAIL: ThreadSanitizer-x86_64 :: ignore_lib3.cc (34470 of 34930)
******************** TEST 'ThreadSanitizer-x86_64 :: ignore_lib3.cc' FAILED ********************
Script:
--
rm -rf /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib3.cc.tmp-dir
mkdir /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib3.cc.tmp-dir
/home/ekarpenkov/code/llvm/release-build/./bin/clang --driver-mode=g++ -fsanitize=thread -Wall -m64 -gline-tables-only -I/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/../ -std=c++11 -I/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/../ -O1 /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib3.cc -DLIB -fPIC -fno-sanitize=thread -shared -o /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib3.cc.tmp-dir/libignore_lib3.so
/home/ekarpenkov/code/llvm/release-build/./bin/clang --driver-mode=g++ -fsanitize=thread -Wall -m64 -gline-tables-only -I/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/../ -std=c++11 -I/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/../ -O1 /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib3.cc -o /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib3.cc.tmp
env TSAN_OPTIONS=atexit_sleep_ms=0:suppressions='/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib3.cc.supp' /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/deflake.bash  /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib3.cc.tmp | FileCheck /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib3.cc
--
Exit Code: 1

Command Output (stderr):
--
/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib3.cc:37:11: error: expected string not found in input
// CHECK: ThreadSanitizer: library {{.*}} that was matched against called_from_lib suppression 'ignore_lib3.so' is unloaded
          ^
<stdin>:2:1: note: scanning from here

^

--

********************
FAIL: ThreadSanitizer-x86_64 :: ignore_lib4.cc (34478 of 34930)
******************** TEST 'ThreadSanitizer-x86_64 :: ignore_lib4.cc' FAILED ********************
Script:
--
rm -rf /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib4.cc.tmp-dir
mkdir /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib4.cc.tmp-dir
/home/ekarpenkov/code/llvm/release-build/./bin/clang --driver-mode=g++ -fsanitize=thread -Wall -m64 -gline-tables-only -I/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/../ -std=c++11 -I/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/../ -O1 /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib4.cc -DLIB -fPIC -shared -o /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib4.cc.tmp-dir/libignore_lib4.so
/home/ekarpenkov/code/llvm/release-build/./bin/clang --driver-mode=g++ -fsanitize=thread -Wall -m64 -gline-tables-only -I/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/../ -std=c++11 -I/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/../ -O1 /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib4.cc -o /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib4.cc.tmp
echo "called_from_lib:libignore_lib4.so" > /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib4.cc.tmp.supp
env TSAN_OPTIONS=atexit_sleep_ms=0:suppressions='/home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib4.cc.tmp.supp'  /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib4.cc.tmp 2>&1 | FileCheck /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib4.cc
--
Exit Code: 2

Command Output (stderr):
--
FileCheck error: '-' is empty.
FileCheck command line:  FileCheck /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib4.cc

--

********************
FAIL: ThreadSanitizer-x86_64 :: ignore_lib5.cc (34494 of 34930)
******************** TEST 'ThreadSanitizer-x86_64 :: ignore_lib5.cc' FAILED ********************
Script:
--
rm -rf /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib5.cc.tmp-dir
mkdir /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib5.cc.tmp-dir
/home/ekarpenkov/code/llvm/release-build/./bin/clang --driver-mode=g++ -fsanitize=thread -Wall -m64 -gline-tables-only -I/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/../ -std=c++11 -I/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/../ -O1 /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib5.cc -DLIB -fPIC -fno-sanitize=thread -shared -o /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib5.cc.tmp-dir/libignore_lib1.so
/home/ekarpenkov/code/llvm/release-build/./bin/clang --driver-mode=g++ -fsanitize=thread -Wall -m64 -gline-tables-only -I/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/../ -std=c++11 -I/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/../ -O1 /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib5.cc -o /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib5.cc.tmp
echo running w/o suppressions:
/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/deflake.bash  /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib5.cc.tmp | FileCheck /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib5.cc --check-prefix=CHECK-NOSUPP
echo running with suppressions:
env TSAN_OPTIONS=atexit_sleep_ms=0:suppressions='/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib5.cc.supp'  /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib5.cc.tmp 2>&1 | FileCheck /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib5.cc --check-prefix=CHECK-WITHSUPP
--
Exit Code: 1

Command Output (stdout):
--
running w/o suppressions:

--
Command Output (stderr):
--
/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib5.cc:76:18: error: expected string not found in input
// CHECK-NOSUPP: WARNING: ThreadSanitizer: data race
                 ^
<stdin>:1:1: note: scanning from here
failed to load the library (12)
^
<stdin>:1:8: note: possible intended match here
failed to load the library (12)
       ^

--

********************
FAIL: ThreadSanitizer-x86_64 :: ignore_lib2.cc (34500 of 34930)
******************** TEST 'ThreadSanitizer-x86_64 :: ignore_lib2.cc' FAILED ********************
Script:
--
rm -rf /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib2.cc.tmp-dir
mkdir /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib2.cc.tmp-dir
/home/ekarpenkov/code/llvm/release-build/./bin/clang --driver-mode=g++ -fsanitize=thread -Wall -m64 -gline-tables-only -I/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/../ -std=c++11 -I/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/../ -O1 /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib2.cc -DLIB -fPIC -fno-sanitize=thread -shared -o /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib2.cc.tmp-dir/libignore_lib2_0.so
/home/ekarpenkov/code/llvm/release-build/./bin/clang --driver-mode=g++ -fsanitize=thread -Wall -m64 -gline-tables-only -I/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/../ -std=c++11 -I/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/../ -O1 /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib2.cc -DLIB -fPIC -fno-sanitize=thread -shared -o /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib2.cc.tmp-dir/libignore_lib2_1.so
/home/ekarpenkov/code/llvm/release-build/./bin/clang --driver-mode=g++ -fsanitize=thread -Wall -m64 -gline-tables-only -I/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/../ -std=c++11 -I/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/../ -O1 /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib2.cc -o /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib2.cc.tmp
env TSAN_OPTIONS=atexit_sleep_ms=0:suppressions='/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib2.cc.supp' /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/deflake.bash  /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/ignore_lib2.cc.tmp | FileCheck /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib2.cc
--
Exit Code: 2

Command Output (stderr):
--
FileCheck error: '-' is empty.
FileCheck command line:  FileCheck /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/ignore_lib2.cc

--

********************
FAIL: ThreadSanitizer-x86_64 :: simple_stack2.cc (34558 of 34930)
******************** TEST 'ThreadSanitizer-x86_64 :: simple_stack2.cc' FAILED ********************
Script:
--
rm -rf /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/simple_stack2.cc.tmp-dir
mkdir /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/simple_stack2.cc.tmp-dir
/home/ekarpenkov/code/llvm/release-build/./bin/clang --driver-mode=g++ -fsanitize=thread -Wall -m64 -gline-tables-only -I/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/../ -std=c++11 -I/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/../ -O1 /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/simple_stack2.cc -o /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/simple_stack2.cc.tmp-dir/simple_stack2.cc.exe && /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/deflake.bash  /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config/Output/simple_stack2.cc.tmp-dir/simple_stack2.cc.exe | FileCheck /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/simple_stack2.cc
--
Exit Code: 1

Command Output (stderr):
--
/home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/simple_stack2.cc:50:16: error: expected string not found in input
// CHECK-NEXT: #0 foo1{{.*}} {{.*}}simple_stack2.cc:7{{(:10)?}} ({{.*}})
               ^
<stdin>:4:2: note: scanning from here
 #0 foo1() /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/simple_stack2.cc:10:10 (simple_stack2.cc.exe+0x4b9604)
 ^
<stdin>:4:87: note: possible intended match here
 #0 foo1() /home/ekarpenkov/code/llvm/projects/compiler-rt/test/tsan/simple_stack2.cc:10:10 (simple_stack2.cc.exe+0x4b9604)
                                                                                      ^

--

********************
Testing Time: 260.47s
********************
Failing Tests (8):
    Profile-x86_64 :: Linux/coverage_test.cpp
    Profile-x86_64 :: Linux/extern_template.test
    ThreadSanitizer-x86_64 :: ignore_lib1.cc
    ThreadSanitizer-x86_64 :: ignore_lib2.cc
    ThreadSanitizer-x86_64 :: ignore_lib3.cc
    ThreadSanitizer-x86_64 :: ignore_lib4.cc
    ThreadSanitizer-x86_64 :: ignore_lib5.cc
    ThreadSanitizer-x86_64 :: simple_stack2.cc

  Expected Passes    : 33542
  Expected Failures  : 183
  Unsupported Tests  : 1197
  Unexpected Failures: 8

2 warning(s) in tests.
FAILED: cd /home/ekarpenkov/code/llvm/release-build && /usr/bin/python2.7 /home/ekarpenkov/code/llvm/utils/lit/lit.py -sv --param clang_site_config=/home/ekarpenkov/code/llvm/release-build/tools/clang/test/lit.site.cfg --param llvm_site_config=/home/ekarpenkov/code/llvm/release-build/test/lit.site.cfg --param llvm_unit_site_config=/home/ekarpenkov/code/llvm/release-build/test/Unit/lit.site.cfg /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/builtins/TestCases /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/builtins/Unit/X86_64LinuxConfig /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/interception/Unit /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/lsan/X86_64LsanConfig /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/lsan/X86_64AsanConfig /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/ubsan/Standalone-x86_64 /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/ubsan/AddressSanitizer-x86_64 /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/ubsan/MemorySanitizer-x86_64 /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/ubsan/ThreadSanitizer-x86_64 /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/cfi/Standalone /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/cfi/Devirt /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/cfi/Standalone-thinlto /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/cfi/Devirt-thinlto /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/sanitizer_common/asan-x86_64-Linux /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/sanitizer_common/tsan-x86_64-Linux /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/sanitizer_common/msan-x86_64-Linux /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/sanitizer_common/lsan-x86_64-Linux /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/sanitizer_common/Unit /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/asan/X86_64LinuxConfig /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/asan/Unit /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/dfsan/X86_64Config /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/msan/X86_64Config /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/X86_64Config /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/tsan/Unit /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/safestack /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/esan/X86_64Config /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/scudo/X86_64LinuxConfig /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/profile/Profile-x86_64 /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/xray/X86_64LinuxConfig /home/ekarpenkov/code/llvm/release-build/projects/compiler-rt/test/xray/Unit /home/ekarpenkov/code/llvm/release-build/tools/clang/test /home/ekarpenkov/code/llvm/release-build/utils/lit /home/ekarpenkov/code/llvm/release-build/test
ninja: build stopped: subcommand failed.
kubamracek updated this revision to Diff 110130.Aug 7 2017, 8:55 PM

Thanks for the results! Updating the patch, can you try one more time?

Failing Tests (8):

Profile-x86_64 :: Linux/coverage_test.cpp
Profile-x86_64 :: Linux/extern_template.test

I don't think these two failures are due to my patch...

vitalybuka accepted this revision.Aug 7 2017, 9:45 PM

Patch works for my Linux checkout

test/cfi/target_uninstrumented.cpp
1

rm/mkdir is inconsistent in this patch

Would be nice to have similar pattern everywhere
e.g.
// RUN: rm -rf %t-dir && mkdir %t-dir [&& cd %t-dir]

This revision is now accepted and ready to land.Aug 7 2017, 9:45 PM
rnk added a subscriber: rnk.Aug 8 2017, 10:21 AM
rnk added inline comments.
test/asan/TestCases/suppressions-library.cc
7–8

Remove this, there are no more backticks now.

filcab accepted this revision.Apr 12 2018, 2:55 AM

Hi Kuba,

This has stalled for a while. Can you update + commit?

Thank you,
Filipe

test/asan/TestCases/Darwin/dyld_insert_libraries_reexec.cc
6

Minor nit: Make this %t-dir, like the others.

Hi Kuba,

Any remaining problem on this patch? It's blocking your D35396 patch, which I'd also like to see committed.
If you want, I can also take it off your hands and push it, if you're low on time for it.

Thank you,
Filipe

I think this is out of sync with recent changes in the way .so/.dylib files are handled.

If you want, I can also take it off your hands and push it, if you're low on time for it.

If you have time, that would be amazing! I think most of this patch should be fine, so perhaps landing only some parts would be a good way forward.

Thanks!

filcab commandeered this revision.Jul 3 2018, 5:29 AM
filcab edited reviewers, added: kubamracek; removed: filcab.

"Commandeering" revision. I will post an updated patch in a bit, if all goes well with arc.

filcab updated this revision to Diff 153899.Jul 3 2018, 5:31 AM

Commandeering revision and posting an updated patch. Please review.

Herald added subscribers: Restricted Project, delcypher. · View Herald TranscriptJul 3 2018, 5:31 AM
rnk accepted this revision.Jul 19 2018, 4:37 PM

Go for it, I think @vitalybuka's stamp from before is enough.

filcab closed this revision.Jul 20 2018, 6:26 AM

Phabricator didn't pick it up. This was committed on July 10.