diff options
author | Dmitry Vyukov <dvyukov@google.com> | 2013-08-16 11:15:14 +0000 |
---|---|---|
committer | Dmitry Vyukov <dvyukov@google.com> | 2013-08-16 11:15:14 +0000 |
commit | 9d95475f8adb1e08e45484feb03570ae2be2d0f3 (patch) | |
tree | 04275bb29b48146cac48ad8c23a5050769719d4f /lib/tsan/go | |
parent | a0e78c9dbd9cc27aebf765cc69a1158df5a05bb9 (diff) |
tsan: better report formatting for Go
Say that gorotuine 1 is main goroutine.
Remove excessive new line.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188542 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/tsan/go')
-rwxr-xr-x | lib/tsan/go/buildgo.sh | 4 | ||||
-rw-r--r-- | lib/tsan/go/test.c | 20 |
2 files changed, 18 insertions, 6 deletions
diff --git a/lib/tsan/go/buildgo.sh b/lib/tsan/go/buildgo.sh index bffa276c1..52a056ab6 100755 --- a/lib/tsan/go/buildgo.sh +++ b/lib/tsan/go/buildgo.sh @@ -26,7 +26,7 @@ SRCS=" if [ "`uname -a | grep Linux`" != "" ]; then SUFFIX="linux_amd64" - OSCFLAGS="-fPIC -ffreestanding" + OSCFLAGS="-fPIC -ffreestanding -Wno-maybe-uninitialized" OSLDFLAGS="-lpthread -fPIC -fpie" SRCS+=" ../rtl/tsan_platform_linux.cc @@ -65,7 +65,7 @@ for F in $SRCS; do cat $F >> gotsan.cc done -FLAGS=" -I../rtl -I../.. -I../../sanitizer_common -I../../../include -m64 -Wall -Werror -Wno-maybe-uninitialized -fno-exceptions -fno-rtti -DTSAN_GO -DSANITIZER_GO -DTSAN_SHADOW_COUNT=4 $OSCFLAGS" +FLAGS=" -I../rtl -I../.. -I../../sanitizer_common -I../../../include -m64 -Wall -Werror -fno-exceptions -fno-rtti -DTSAN_GO -DSANITIZER_GO -DTSAN_SHADOW_COUNT=4 $OSCFLAGS" if [ "$DEBUG" == "" ]; then FLAGS+=" -DTSAN_DEBUG=0 -O3 -fomit-frame-pointer" else diff --git a/lib/tsan/go/test.c b/lib/tsan/go/test.c index 902dfc915..859b35d34 100644 --- a/lib/tsan/go/test.c +++ b/lib/tsan/go/test.c @@ -34,20 +34,32 @@ int __tsan_symbolize(void *pc, char **img, char **rtn, char **file, int *l) { char buf[10]; +void foobar() {} +void barfoo() {} + int main(void) { void *thr0 = 0; __tsan_init(&thr0); __tsan_map_shadow(buf, sizeof(buf) + 4096); - __tsan_func_enter(thr0, &main); + __tsan_func_enter(thr0, (char*)&main + 1); __tsan_malloc(thr0, buf, 10, 0); __tsan_release(thr0, buf); __tsan_release_merge(thr0, buf); void *thr1 = 0; - __tsan_go_start(thr0, &thr1, 0); - __tsan_write(thr1, buf, 0); + __tsan_go_start(thr0, &thr1, (char*)&barfoo + 1); + void *thr2 = 0; + __tsan_go_start(thr0, &thr2, (char*)&barfoo + 1); + __tsan_func_enter(thr1, (char*)&foobar + 1); + __tsan_func_enter(thr1, (char*)&foobar + 1); + __tsan_write(thr1, buf, (char*)&barfoo + 1); __tsan_acquire(thr1, buf); + __tsan_func_exit(thr1); + __tsan_func_exit(thr1); __tsan_go_end(thr1); - __tsan_read(thr0, buf, 0); + __tsan_func_enter(thr2, (char*)&foobar + 1); + __tsan_read(thr2, buf, (char*)&barfoo + 1); + __tsan_func_exit(thr2); + __tsan_go_end(thr2); __tsan_free(buf); __tsan_func_exit(thr0); __tsan_fini(); |