From: Dmitry Vyukov Date: Fri, 28 Oct 2016 15:12:39 +0000 (+0200) Subject: runtime/race: update race runtime X-Git-Tag: go1.8beta1~454 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=042264ef1b073b1b485e6e24977e506e1a6bdb3f;p=gostls13.git runtime/race: update race runtime This updates the runtime to HEAD to keep it aligned and fixes some bugs. http://llvm.org/viewvc/llvm-project?view=revision&revision=285454 fixes the crash on darwin related to unaligned data section (#17065). http://llvm.org/viewvc/llvm-project?view=revision&revision=285451 enables core dumps by default (#16527). http://llvm.org/viewvc/llvm-project?view=revision&revision=285455 adds a hook to obtain number of races reported so far (#15972). Can now be obtained with: //go:nosplit func RaceReportCount() int { var n uint64 racecall(&__tsan_report_count, uintptr(unsafe.Pointer(&n)), 0, 0, 0) return int(n) } Fixes #16527. Fixes #17065. Update #15972. Change-Id: I8f869cb6275c9521a47303f3810a9965e9314357 Reviewed-on: https://go-review.googlesource.com/32160 Run-TryBot: Dmitry Vyukov TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index 3aef0afb23..7629547279 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -1061,8 +1061,7 @@ func (t *tester) raceTest(dt *distTest) error { // The race builder should catch any error here, but doesn't. // TODO(iant): Figure out how to catch this. // t.addCmd(dt, "src", "go", "test", "-race", "-run=TestParallelTest", "cmd/go") - // TODO: Remove t.goos != "darwin" when issue 17065 is fixed. - if t.cgoEnabled && t.goos != "darwin" { + if t.cgoEnabled { env := mergeEnvLists([]string{"GOTRACEBACK=2"}, os.Environ()) cmd := t.addCmd(dt, "misc/cgo/test", "go", "test", "-race", "-short", t.runFlag("")) cmd.Env = env diff --git a/src/runtime/race.go b/src/runtime/race.go index 6f24e09925..c8af8f6f50 100644 --- a/src/runtime/race.go +++ b/src/runtime/race.go @@ -176,6 +176,9 @@ var __tsan_go_ignore_sync_begin byte //go:linkname __tsan_go_ignore_sync_end __tsan_go_ignore_sync_end var __tsan_go_ignore_sync_end byte +//go:linkname __tsan_report_count __tsan_report_count +var __tsan_report_count byte + // Mimic what cmd/cgo would do. //go:cgo_import_static __tsan_init //go:cgo_import_static __tsan_fini @@ -192,6 +195,7 @@ var __tsan_go_ignore_sync_end byte //go:cgo_import_static __tsan_release_merge //go:cgo_import_static __tsan_go_ignore_sync_begin //go:cgo_import_static __tsan_go_ignore_sync_end +//go:cgo_import_static __tsan_report_count // These are called from race_amd64.s. //go:cgo_import_static __tsan_read diff --git a/src/runtime/race/README b/src/runtime/race/README index 95e241c072..398b22f71e 100644 --- a/src/runtime/race/README +++ b/src/runtime/race/README @@ -4,4 +4,4 @@ the LLVM project (http://llvm.org/git/compiler-rt.git). To update the .syso files use golang.org/x/build/cmd/racebuild. -Current runtime is built on rev e35e7c00b5c7e7ee5e24d537b80cb0d34cebb038. +Current runtime is built on rev 68e1532492f9b3fce0e9024f3c31411105965b11. diff --git a/src/runtime/race/race_darwin_amd64.syso b/src/runtime/race/race_darwin_amd64.syso index c19740fb8f..89c7f57901 100644 Binary files a/src/runtime/race/race_darwin_amd64.syso and b/src/runtime/race/race_darwin_amd64.syso differ diff --git a/src/runtime/race/race_freebsd_amd64.syso b/src/runtime/race/race_freebsd_amd64.syso index df1bc26861..6312ce8f35 100644 Binary files a/src/runtime/race/race_freebsd_amd64.syso and b/src/runtime/race/race_freebsd_amd64.syso differ diff --git a/src/runtime/race/race_linux_amd64.syso b/src/runtime/race/race_linux_amd64.syso index 174033041e..3795520c9b 100644 Binary files a/src/runtime/race/race_linux_amd64.syso and b/src/runtime/race/race_linux_amd64.syso differ diff --git a/src/runtime/race/race_windows_amd64.syso b/src/runtime/race/race_windows_amd64.syso index fd93959af5..b85f5d6e9b 100644 Binary files a/src/runtime/race/race_windows_amd64.syso and b/src/runtime/race/race_windows_amd64.syso differ