llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

Migrate the rest of tsan tests to cmake/lit

Open KernelAddress opened this issue 11 years ago • 6 comments

Bugzilla Link 22009
Resolution FIXED
Resolved on Dec 08, 2015 12:01
Version unspecified
OS Linux
CC @KernelAddress,@kcc

Extended Description

Part of tsan tests were migrated to cmake/lit (output tests), but the rest is left in 'make presubmit'. This is effectively equivalent to removal of part of useful tests as people started to ignore 'make presubmit'.

First, Go runtime become broken:

(cd go && ./buildgo.sh) gcc gotsan.cc -c -o race_linux_amd64.syso -I../rtl -I../.. -I../../sanitizer_common -I../../../include -std=c++11 -m64 -Wall -fno-exceptions -fno-rtti -DSANITIZER_GO -DTSAN_SHADOW_COUNT=4 -DSANITIZER_DEADLOCK_DETECTOR_VERSION=2 -fPIC -ffreestanding -Wno-maybe-uninitialized -Wno-unused-const-variable -Werror -Wno-unknown-warning-option -DTSAN_DEBUG=0 -O3 -msse3 -fomit-frame-pointer race_linux_amd64.syso: In function __sanitizer::internal_start_thread(void (*)(void*), void*)': gotsan.cc:(.text+0x104d6): undefined reference to __sanitizer::real_pthread_create(void*, void*, void* ()(void), void*)' race_linux_amd64.syso: In function __sanitizer::internal_join_thread(void*)': gotsan.cc:(.text+0x10503): undefined reference to __sanitizer::real_pthread_join(void*, void**)' collect2: error: ld returned 1 exit status

Now the rest become broken:

(ulimit -s 8192; ./tsan_test) ==18778==FATAL: ThreadSanitizer: failed to intercept memcpy make[1]: *** [run] Error 1

Please finish the migration to cmake/lit: restore what 'make presubmit' does:

presubmit: ../sanitizer_common/scripts/check_lint.sh # Debug build with clang. $(MAKE) -f Makefile.old clean $(MAKE) -f Makefile.old run DEBUG=1 -j 16 CC=$(CLANG) CXX=$(CLANG)++ # Release build with clang. $(MAKE) -f Makefile.old clean $(MAKE) -f Makefile.old run DEBUG=0 -j 16 CC=$(CLANG) CXX=$(CLANG)++ ./check_memcpy.sh # Debug build with gcc $(MAKE) -f Makefile.old clean $(MAKE) -f Makefile.old run DEBUG=1 -j 16 CC=gcc CXX=g++ # Release build with gcc $(MAKE) -f Makefile.old clean $(MAKE) -f Makefile.old run DEBUG=0 -j 16 CC=gcc CXX=g++ ./check_memcpy.sh ./check_analyze.sh # Sanity check for Go runtime (cd go && ./buildgo.sh)

and run tests with -O0/-O2 as asan does.

KernelAddress avatar Dec 23 '14 10:12 KernelAddress

Done as of r255032.

llvmbot avatar Dec 08 '15 20:12 llvmbot

Are we interested in supporting build configuration with TSAN_COLLECT_STATS and TSAN_DEBUG_OUTPUT?

It would be nice to have. We can just build in that mode, but don't run tests. The problem is that debug prints frequently get rotten due to renamed/removed/changed variables.

KernelAddress avatar Dec 02 '15 18:12 KernelAddress

I believe we can just build with -DCOMPILER_RT_DEBUG=ON, and it will build runtimes with -O0 and -DSANITIZER_DEBUG=1. I can look into porting check_analyze.sh (and maybe check_memcpy.sh) to lit. Are we interested in supporting build configuration with TSAN_COLLECT_STATS and TSAN_DEBUG_OUTPUT?

llvmbot avatar Dec 01 '15 21:12 llvmbot

Alexey, is it feasible to build debug version of tsan runtime for lit tests? The other remaining part is check_memcpy.sh/check_analyze.sh We can drop explicit gcc/clang tests.

KernelAddress avatar Dec 01 '15 20:12 KernelAddress

FTR debug TSan build, and Go build, are now checked in the upstream bot: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-autoconf

I plan to port building Go runtime to CMake, so that people can see errors in a regular CMake build, before they check in the code, and without running ./buildgo.sh script.

llvmbot avatar Jan 31 '15 01:01 llvmbot

Right. We should have added support for at least building Go runtime long ago, as we break it far too often. Thanks for bringing this up. We used to have the buildbot, that runs "make presubmit" in TSan, it broke down at some point and was never fixed. Could you revive it, so that we won't make situation worse until we port most of the remaining checks to CMake?

llvmbot avatar Dec 23 '14 21:12 llvmbot