Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Run script:
- $ cat tryForKuba.sh
- # With and without the original patch.
- NO_D84570=/home/nemanjai/llvm/Git/trunk1/install/bin/clang
- WITH_D84570=/home/nemanjai/llvm/Git/trunk1/build/bin/clang
- $NO_D84570 -O0 variadic-tsan.cpp -o clean.O0
- $NO_D84570 -O1 variadic-tsan.cpp -o clean.O1
- $NO_D84570 -O2 variadic-tsan.cpp -o clean.O2
- $NO_D84570 -O0 variadic-tsan.cpp -fsanitize=thread -o clean.tsan.O0
- $NO_D84570 -O1 variadic-tsan.cpp -fsanitize=thread -o clean.tsan.O1
- $NO_D84570 -O2 variadic-tsan.cpp -fsanitize=thread -o clean.tsan.O2
- $WITH_D84570 -O0 variadic-tsan.cpp -o d84570.O0
- $WITH_D84570 -O1 variadic-tsan.cpp -o d84570.O1
- $WITH_D84570 -O2 variadic-tsan.cpp -o d84570.O2
- $WITH_D84570 -O0 variadic-tsan.cpp -fsanitize=thread -o d84570.tsan.O0
- $WITH_D84570 -O1 variadic-tsan.cpp -fsanitize=thread -o d84570.tsan.O1
- $WITH_D84570 -O2 variadic-tsan.cpp -fsanitize=thread -o d84570.tsan.O2
- # Apply the additional patch and try again.
- echo "Applying the following patch"
- cat $LLVM_SRC/NewPatch.diff
- cd $LLVM_SRC/..
- git apply $LLVM_SRC/NewPatch.diff
- cd /home/nemanjai/llvm/Git/trunk1/build
- ninja
- cd $LLVM_SRC
- WITH_BOTH=/home/nemanjai/llvm/Git/trunk1/build/bin/clang
- $WITH_BOTH -O0 variadic-tsan.cpp -o both.O0
- $WITH_BOTH -O1 variadic-tsan.cpp -o both.O1
- $WITH_BOTH -O2 variadic-tsan.cpp -o both.O2
- $WITH_BOTH -O0 variadic-tsan.cpp -fsanitize=thread -o both.tsan.O0
- $WITH_BOTH -O1 variadic-tsan.cpp -fsanitize=thread -o both.tsan.O1
- $WITH_BOTH -O2 variadic-tsan.cpp -fsanitize=thread -o both.tsan.O2
- for EXE in clean.O0 clean.O1 clean.O2 clean.tsan.O0 clean.tsan.O1 clean.tsan.O2 \
- d84570.O0 d84570.O1 d84570.O2 d84570.tsan.O0 d84570.tsan.O1 d84570.tsan.O2 \
- both.O0 both.O1 both.O2 both.tsan.O0 both.tsan.O1 both.tsan.O2
- do
- echo "Running $EXE:"
- ./$EXE tmp.txt
- echo -e "\n\n"
- done
- # Run the script:
- $ ./tryForKuba.sh
- Applying the following patch
- diff --git a/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp b/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
- --- a/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
- +++ b/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
- @@ -137,7 +137,11 @@ const int PTHREAD_BARRIER_SERIAL_THREAD = -1;
- #endif
- const int MAP_FIXED = 0x10;
- typedef long long_t;
- +#if SANITIZER_MAC || SANITIZER_FREEBSD || SANITIZER_NETBSD
- typedef __sanitizer::u16 mode_t;
- +#else
- +typedef __sanitizer::u32 mode_t;
- +#endif
- // From /usr/include/unistd.h
- # define F_ULOCK 0 /* Unlock a previously locked region. */
- [0/7] Performing build step for 'builtins'
- ninja: no work to do.
- [1/7] No install step for 'builtins'
- [3/7] Performing configure step for 'runtimes'
- -- Building with -fPIC
- -- Compiler-RT supported architectures: powerpc64le
- -- check-cfi does nothing.
- -- check-cfi-and-supported does nothing.
- -- Generated Sanitizer SUPPORTED_TOOLS list on "Linux" is "asan;lsan;msan;tsan;ubsan"
- -- sanitizer_common tests on "Linux" will run against "asan;lsan;msan;tsan;ubsan"
- -- check-scudo_standalone does nothing.
- -- check-shadowcallstack does nothing.
- Traceback (most recent call last):
- File "<string>", line 22, in <module>
- IndexError: list index out of range
- -- Configuring done
- -- Generating done
- -- Build files have been written to: /home/nemanjai/llvm/Git/trunk1/build/runtimes/runtimes-bins
- [4/7] Performing build step for 'runtimes'
- [7/7] Generating exported symbols for clang_rt.tsan-powerpc64le
- [5/7] No install step for 'runtimes'
- [7/7] Completed 'runtimes'
- Running clean.O0:
- Hello world.
- permissions = 0600
- Done.
- Running clean.O1:
- Hello world.
- permissions = 0600
- Done.
- Running clean.O2:
- Hello world.
- permissions = 0600
- Done.
- Running clean.tsan.O0:
- Hello world.
- permissions = 010
- clean.tsan.O0: variadic-tsan.cpp:16: int main(int, char **): Assertion `result == 0' failed.
- ./tryForKuba.sh: line 37: 142475 Aborted ./$EXE tmp.txt
- Running clean.tsan.O1:
- Hello world.
- permissions = 01
- clean.tsan.O1: variadic-tsan.cpp:16: int main(int, char **): Assertion `result == 0' failed.
- ./tryForKuba.sh: line 37: 142476 Aborted ./$EXE tmp.txt
- Running clean.tsan.O2:
- Hello world.
- permissions = 0600
- Done.
- Running d84570.O0:
- Hello world.
- permissions = 0600
- Done.
- Running d84570.O1:
- Hello world.
- permissions = 0600
- Done.
- Running d84570.O2:
- Hello world.
- permissions = 0600
- Done.
- Running d84570.tsan.O0:
- Hello world.
- permissions = 010
- d84570.tsan.O0: variadic-tsan.cpp:16: int main(int, char **): Assertion `result == 0' failed.
- ./tryForKuba.sh: line 37: 142481 Aborted ./$EXE tmp.txt
- Running d84570.tsan.O1:
- Hello world.
- permissions = 01
- d84570.tsan.O1: variadic-tsan.cpp:16: int main(int, char **): Assertion `result == 0' failed.
- ./tryForKuba.sh: line 37: 142482 Aborted ./$EXE tmp.txt
- Running d84570.tsan.O2:
- Hello world.
- permissions = 0600
- Done.
- Running both.O0:
- Hello world.
- permissions = 0600
- Done.
- Running both.O1:
- Hello world.
- permissions = 0600
- Done.
- Running both.O2:
- Hello world.
- permissions = 0600
- Done.
- Running both.tsan.O0:
- Hello world.
- permissions = 010
- both.tsan.O0: variadic-tsan.cpp:16: int main(int, char **): Assertion `result == 0' failed.
- ./tryForKuba.sh: line 37: 142487 Aborted ./$EXE tmp.txt
- Running both.tsan.O1:
- Hello world.
- permissions = 01
- both.tsan.O1: variadic-tsan.cpp:16: int main(int, char **): Assertion `result == 0' failed.
- ./tryForKuba.sh: line 37: 142488 Aborted ./$EXE tmp.txt
- Running both.tsan.O2:
- Hello world.
- permissions = 0600
- Done.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement