aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/race/README
AgeCommit message (Collapse)Author
2026-03-23runtime/race: apply LLVM zero-initialization fixMichael Pratt
Upstream TSAN had bug that could result in use of uninitialized memory on Go threads that don't have any TSAN events. For example, if the thread only ever runs the GC. This bug was fixed upstream in https://github.com/llvm/llvm-project/commit/cdfdb06c9155080ec97d6e4f4dd90b6e7cefb0ca. In https://go.dev/issue/78059 we have reports of actual Go crashes due to this bug. Update the prebuilt race sysos to incorporate this fix. The fix is applied as a single patch on top of the existing LLVM revisions to minimize risk of this CL, making it safe to backport. A later CL can update to a newer version of LLVM. Note that all of the patch files are identical. CL 756620 makes racebuild add a unique patch file for each architecture in the event that some arches need distinct patches. linux-loong64 failed race.bash when building the new syso, though they were just timeouts, perhaps from a slow builder. linux-riscv64 is not updated because its builder is too slow (https://go.dev/issue/78258). linux-ppc64le is not updated because its builder is missing curl (https://go.dev/issue/78210). openbsd-amd64 is not updated because its builder is missing unzip (https://go.dev/issue/78212). netbsd-amd64 is not updated because it does not have a LUCI builder (https://go.dev/issue/61121). Fixes #78059. Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest-race,gotip-darwin-arm64-race,gotip-darwin-amd64-race,gotip-freebsd-amd64-race,gotip-windows-amd64-race,gotip-linux-s390x-race,gotip-linux-arm64-race,gotip-linux-loong64 Change-Id: I5404cb88af9d86b56b385801f8a9ed106a6a6964 Reviewed-on: https://go-review.googlesource.com/c/go/+/757521 Reviewed-by: Carlos Amedee <carlos@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Bypass: Michael Pratt <mpratt@google.com>
2025-08-29runtime/race: add race detector support for linux/riscv64Joel Sing
This enables support for the race detector on linux/riscv64. Fixes #64345 Cq-Include-Trybots: luci.golang.try:gotip-linux-riscv64 Change-Id: I98962827e91455404858549b0f9691ee438f104b Reviewed-on: https://go-review.googlesource.com/c/go/+/690497 Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com> Reviewed-by: Carlos Amedee <carlos@golang.org>
2025-08-12runtime/race: restore previous version of LLVM TSAN on macOSCherry Mui
Apparently CL 692996 made the Darwin race builders to be very flaky. That CL does two things: 1. uses "ld -r" to strip out the dynamic symbol table; 2. updates to a newer version of LLVM TSAN. To narrow it down, this CL undoes the second part, restpring the previous version of LLVM TSAN, but keeps the "ld -r" part. For #74978. Change-Id: I0611d733232b18440f249cd5a0b76f7e1ff99a55 Reviewed-on: https://go-review.googlesource.com/c/go/+/695137 Reviewed-by: Michael Knyszek <mknyszek@google.com> TryBot-Bypass: Cherry Mui <cherryyz@google.com> Commit-Queue: Cherry Mui <cherryyz@google.com>
2025-08-06runtime/race: update darwin race sysoCherry Mui
On macOS, the script in LLVM TSAN building the race syso files produces the Mach-O object with a malformed dynamic symbol table, which new Apple linker doesn't like and emits an annoying warning (https://github.com/golang/go/issues/61229#issuecomment-1988965927). The dynamic symbol table isn't really needed, as it is a static object. Perhaps it should be fixed in TSAN or the C toolchain, but we can do a simple workaround: pass it through "ld -r", which produces an equivalent object file with LC_DYSYMTAB removed. CL 692975 changes racebuild to do this, which produces new syso's in this CL. While here, build the syso with a newer version of LLVM TSAN. Updates #61229. Change-Id: Ide4b7831eb2cb6877c8ace7b3ec8ff565a9eaf54 Reviewed-on: https://go-review.googlesource.com/c/go/+/692996 Reviewed-by: David Chase <drchase@google.com> TryBot-Bypass: Cherry Mui <cherryyz@google.com>
2025-05-07cmd,runtime: enable race detector on loong64Guoqi Chen
The race feature depends on llvm. And support for building the tsan library on linux/loong64 has been added in this patch [1], which has been merged into the branch main and has landed in llvm18. The support for linux/loong64 in racebuild has been implemented in CL 655775, now racebuild can successfully build race_linux_loong64.syso [2]. [1]: https://github.com/llvm/llvm-project/pull/72819 [2]: racebuild -platforms linux/loong64 -cherrypick 'refs/changes/16/543316/10' \ -rev 83fe85115da9dc25fa270d2ea8140113c8d49670 \ -goroot /home/golang/src/go Co-authored-by: Xiaolin Zhao <zhaoxiaolin@loongson.cn> Change-Id: If389318215476890295ed771297c6c088cfc84b3 Reviewed-on: https://go-review.googlesource.com/c/go/+/543316 Reviewed-by: Qiqi Huang <huangqiqi@loongson.cn> Reviewed-by: Junyang Shao <shaojunyang@google.com> Auto-Submit: Michael Pratt <mpratt@google.com> Reviewed-by: Meidan Li <limeidan@loongson.cn> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com> Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: sophie zhao <zhaoxiaolin@loongson.cn>
2023-11-20runtime/race: update race syso for PPC64LECherry Mui
Following CL 543035, this CL updates race syso for Linux/PPC64LE. Now we have update all of them (except OpenBSD). For #61395. Fixes #62624. Change-Id: I9e1d758355114a50ff206e5d78dc4ea8a06367d8 Reviewed-on: https://go-review.googlesource.com/c/go/+/543397 Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-11-16runtime/race: update race syso files to support atomic And, OrCherry Mui
TSAN recently got support for Go's new atomic And and Or operations (#61395). This CL updates the race syso files to include the change. Also regenerate cgo dynamic imports on darwin. OpenBSD/AMD64 is not updated, as TSAN no longer supports OpenBSD (#52090). Linux/PPC64 is not updated, as I'm running into some builder issues. Still working on it. For #61395. For #62624. Change-Id: Ifc90ea79284f29a356f9e8a5f144f6c690881395 Reviewed-on: https://go-review.googlesource.com/c/go/+/543035 Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
2023-01-25runtime/race: update race_windows_amd64.sysoThan McIntosh
Update race_windows_amd64.syso to latest tsan (V3) runtime. This version of the runtime depends on libsynchronization.a, so to use this syso, you need to also be using a sufficiently up to date version of GCC (notably GCC 5.1, installed on the Go windows builders right now, does not include this library). Updates #48231. Updates #35006. Fixes #49761. Change-Id: Ia1e2b1d8fe7e2c99728150734935a2c522006caa Reviewed-on: https://go-review.googlesource.com/c/go/+/420197 Reviewed-by: Keith Randall <khr@google.com> Run-TryBot: Than McIntosh <thanm@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-10-21runtime/race: add GOAMD64=v3 version of linux race .sysoKeith Randall
Makes -race mode faster, in the 15% speedup range. Update #53743 Change-Id: I735eb71902b41c924c9f885ded8f7a350a56b751 Reviewed-on: https://go-review.googlesource.com/c/go/+/444396 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Than McIntosh <thanm@google.com>
2022-07-11runtime/race: update amd64 syso images to avoid sse4Than McIntosh
Rebuild selected amd64 syso images with updated LLVM build rules that avoid the use of SSE4, so as to ensure that the Go race detector continues to work on older x86 cpus. No changes to the syso files for openbsd/amd64 (upstream support has been removed in LLVM) or netbsd/amd64 (work still in progress there). Fixes #53743. Change-Id: I738ae4d1e0528c6e06dd4ddb78e7039a30a51779 Reviewed-on: https://go-review.googlesource.com/c/go/+/416857 Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Than McIntosh <thanm@google.com>
2022-04-22runtime/race: add s390x .syso fileKeith Randall
Built using racebuild. Note that racebuild fails when trying to test the .syso, because the Go runtime doesn't think we support s390x race yet. But it builds the .syso as a side effect which I grabbed. There's something of a chicken-and-egg bootstrapping problem here, unfortunately. Change-Id: Ibc6d04fd3a9bfb3224d08e8b78dcf09bb139a59d Reviewed-on: https://go-review.googlesource.com/c/go/+/401714 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Jonathan Albrecht <jonathan.albrecht@ibm.com>
2022-04-04runtime/race: update PPC64LE syso file to new TSAN runtime (v3)Cherry Mui
In CL 397494 Linux/PPC64LE syso was not updated due to test failure. It should be fixed by the previous CL and should work now. Change-Id: Ieb0993ded5541397094d3aecae28c5255c822eac Reviewed-on: https://go-review.googlesource.com/c/go/+/397676 Trust: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
2022-04-01runtime/race: update syso files to new TSAN runtime (v3)Cherry Mui
Following CL 333529, update syso files for other architectures. Windows/AMD64 is not updated, waiting for Than for C toolchain updates. OpenBSD/AMD64 is not updated as upstream LLVM TSAN removed OpenBSD support (#52090). Linux/PPC64LE is not updated due to a test failure. Will look into it. Change-Id: I46441fd3bb0f2c9e372d3e7fd43744ffafaf87a1 Reviewed-on: https://go-review.googlesource.com/c/go/+/397494 Trust: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@golang.org>
2022-03-28runtime/race: update runtime (v3)Dmitry Vyukov
New tsan runtime (v3) built on llvm commit 1784fe0532a6. The new runtime features: - 2x smaller shadow memory (2x of app memory) - faster fully vectorized (on x86) race detection - small fixed-size vector clocks (512b) - fast vectorized vector clock operations - unlimited number of alive threads/goroutines Some random subset of benchmarks: encoding/json: CodeEncoder-72 20.3ms ± 6% 11.7ms ± 4% -42.02% (p=0.000 n=10+8) CodeMarshal-72 22.3ms ±11% 12.7ms ±11% -43.28% (p=0.000 n=10+10) CodeDecoder-72 46.1ms ±42% 20.2ms ± 7% -56.18% (p=0.000 n=10+10) CodeUnmarshal-72 16.7ms ±14% 13.2ms ± 9% -20.93% (p=0.000 n=10+10) CodeUnmarshalReuse-72 17.7ms ±17% 12.8ms ± 8% -27.58% (p=0.000 n=10+10) net/http: ClientServerParallel4-72 914µs ±18% 72µs ± 5% -92.16% (p=0.000 n=20+18) ClientServerParallel64-72 1.77ms ±16% 0.12ms ±29% -93.43% (p=0.000 n=20+17) ClientServerParallelTLS4-72 1.99ms ±33% 0.20ms ± 5% -89.83% (p=0.000 n=19+17) ClientServerParallelTLS64-72 2.72ms ±26% 0.25ms ±16% -90.96% (p=0.000 n=20+16) compress/flate: Decode/Digits/Huffman/1e4-72 2.53ms ± 3% 1.47ms ± 4% -41.72% (p=0.000 n=9+10) Decode/Digits/Speed/1e4-72 2.59ms ± 5% 1.52ms ± 3% -41.44% (p=0.000 n=8+9) Decode/Digits/Default/1e4-72 2.56ms ± 6% 1.51ms ± 4% -40.96% (p=0.000 n=10+10) Decode/Digits/Compression/1e4-72 2.54ms ± 6% 1.52ms ± 2% -40.14% (p=0.000 n=10+9) Decode/Newton/Huffman/1e4-72 2.65ms ± 3% 1.58ms ± 4% -40.45% (p=0.000 n=10+10) Decode/Newton/Speed/1e4-72 2.16ms ± 9% 1.28ms ± 5% -40.59% (p=0.000 n=10+10) Decode/Newton/Default/1e4-72 2.01ms ± 8% 1.16ms ± 6% -42.11% (p=0.000 n=10+10) Decode/Newton/Compression/1e4-72 1.99ms ± 6% 1.17ms ± 3% -41.05% (p=0.000 n=9+10) Encode/Digits/Huffman/1e4-72 2.05ms ± 2% 0.75ms ± 5% -63.32% (p=0.000 n=10+10) Encode/Digits/Speed/1e4-72 2.89ms ± 2% 1.37ms ± 2% -52.56% (p=0.000 n=9+10) Encode/Digits/Default/1e4-72 7.55ms ± 2% 3.86ms ± 4% -48.93% (p=0.000 n=8+10) Encode/Digits/Compression/1e4-72 7.46ms ± 4% 3.88ms ± 4% -48.07% (p=0.000 n=9+9) Encode/Newton/Huffman/1e4-72 2.20ms ± 4% 0.90ms ± 6% -59.01% (p=0.000 n=10+10) Encode/Newton/Speed/1e4-72 2.62ms ± 2% 1.30ms ± 4% -50.52% (p=0.000 n=9+10) Encode/Newton/Default/1e4-72 7.40ms ± 5% 3.72ms ± 2% -49.65% (p=0.000 n=10+9) Encode/Newton/Compression/1e4-72 7.67ms ± 9% 3.85ms ± 4% -49.87% (p=0.000 n=10+10) encoding/json short tests: Time 2.34sec ± 6% 1.67sec ±11% -28.85% (p=0.000 n=10+10) Memory 266MB ± 1% 190MB ± 9% -28.78% (p=0.000 n=10+10) compress/flate short tests: Time 4.69sec ± 4% 2.78sec ± 3% -40.61% (p=0.000 n=10+10) Memory 284MB ± 5% 181MB ± 4% -36.04% (p=0.000 n=10+9) sync short tests: Time 4.87sec ± 4% 0.87sec ± 6% -82.21% (p=0.000 n=10+10) Memory 147MB ± 3% 99MB ± 8% -32.47% (p=0.000 n=10+9) Fixes #47056 Fixes #38184 Change-Id: I0cf228f2e4cac7778d34d33e46df7c081645f5d5 Reviewed-on: https://go-review.googlesource.com/c/go/+/333529 Run-TryBot: Dmitry Vyukov <dvyukov@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitry Vyukov <dvyukov@google.com> Trust: Dmitry Vyukov <dvyukov@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-12-02runtime/race: rebuild darwin syso to work around macOS 12 malloc reserved ↵Cherry Mui
address On macOS 12 a new malloc implementation (nano) is used by default, and apparently it reserves address range 0x600000000000-0x600020000000, which conflicts with the address range that TSAN uses for Go. Work around the issue by changing the address range slightly. The actual change is made on LLVM at https://reviews.llvm.org/D114825 . This CL includes syso's built with the patch applied. Fixes #49138. Change-Id: I7b367d6e042b0db39a691c71601c98e4f8728a70 Reviewed-on: https://go-review.googlesource.com/c/go/+/367916 Trust: Cherry Mui <cherryyz@google.com> Reviewed-by: Austin Clements <austin@google.com>
2021-03-10runtime/race: update dead linkMichael Pratt
LLVM changed their main branch name, so this link didn't work anymore. Change-Id: I4c3a67b26e2bda012071281e29ea3c932c185130 Reviewed-on: https://go-review.googlesource.com/c/go/+/300469 Trust: Michael Pratt <mpratt@google.com> Run-TryBot: Michael Pratt <mpratt@google.com> Reviewed-by: Dmitry Vyukov <dvyukov@google.com> TryBot-Result: Go Bot <gobot@golang.org>
2021-02-23runtime: enable race detector on openbsd/amd64Joel Sing
Now that this commit[1] has landed in LLVM the .syso file can be generated for OpenBSD. With the changes to src/runtime running the sample race[2] detects the data race as expected. Based on golang/go#39464 (https://go-review.googlesource.com/c/go/+/237057) from Aaron Bieber <deftly@gmail.com>, however the race_openbsd_amd64.syso file has been built on OpenBSD 6.4 and necessary changes added to race.bash. [1] https://github.com/llvm/llvm-project/commit/fcf6ae2f070eba73074b6ec8d8281e54d29dbeeb [2] https://golang.org/doc/articles/race_detector.html Change-Id: Ic2479ccfa91d6b2cb4585346a11d813d96450f68 Reviewed-on: https://go-review.googlesource.com/c/go/+/275892 Trust: Joel Sing <joel@sing.id.au> Run-TryBot: Joel Sing <joel@sing.id.au> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
2020-10-30runtime, cmd: support race detector on darwin/arm64Cherry Zhang
https://reviews.llvm.org/D90435 is the counterpart in LLVM TSAN. race_linux_arm64.syso is built with LLVM commit 00da38ce2d36c07f12c287dc515d37bb7bc410e9 on a macOS/ARM64 machine. (It is not built on a builder with golang.org/x/build/cmd/racebuild as we don't have darwin/arm64 builder for now.) Updates #38485. Change-Id: I391efdacd9480197e308370bfccd05777deb4aee Reviewed-on: https://go-review.googlesource.com/c/go/+/266373 Trust: Cherry Zhang <cherryyz@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-10-21runtime/race: update race .syso filesKeith Randall
Fixes #39186 Change-Id: I624ab73b3083f190978c09716672ce1b712a5c81 Reviewed-on: https://go-review.googlesource.com/c/go/+/264082 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Keith Randall <khr@golang.org>
2020-08-01runtime/race: rebuild some .syso files to remove getauxval dependencyKeith Randall
We can't depend on getauxval because it only exists in glibc >= 2.16. Tsan has been updated to avoid that dependency (https://reviews.llvm.org/D84859). This CL rebuilds the affected .syso files, and adds a test to make sure we don't regress. Fixes #37485 Change-Id: I891f54d28ec0d7da50a8df1adadc76dd6e7ab3e0 Reviewed-on: https://go-review.googlesource.com/c/go/+/246258 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
2020-05-01runtime/race: rebuild race detector .syso filesKeith Randall
Update #37355 Change-Id: I90cc121c158a9d44df01772083a7a9301598532e Reviewed-on: https://go-review.googlesource.com/c/go/+/231297 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
2020-04-12runtime/race: rebuild netbsd .sysoKeith Randall
Fixes #14481 Fixes #37355 Change-Id: Idfceaf0e64d340b7304ce9562549a82ebfc27e3c Reviewed-on: https://go-review.googlesource.com/c/go/+/227867 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
2020-04-08runtime/race: update ppc64 .syso fileKeith Randall
Update #14881 Update #37355 Change-Id: I5edd53b7532836cfe6037fb668b1b8fe8f7a32f9 Reviewed-on: https://go-review.googlesource.com/c/go/+/227443 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
2020-04-03runtime/race: update some .syso filesKeith Randall
Update race detector syso files for some platforms. There's still 2 more to do, but they might take a while so I'm mailing the ones I have now. Note: some arm64 tests did not complete successfully due to out of memory errors, but I suspect the .syso is correct. Update #14481 Update #37485 (I think?) Update #37355 Change-Id: I7e7e707a1fd7574855a538ba89dc11acc999c760 Reviewed-on: https://go-review.googlesource.com/c/go/+/226981 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-02-07runtime/race: update reference to compiler-rt sourcesIan Lance Taylor
Change-Id: Iabe46677f24fef6e482a4beca774dbfc553026a2 Reviewed-on: https://go-review.googlesource.com/c/go/+/217778 Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
2019-10-18runtime/race: update race detector shared librariesKeith Randall
Pulls in a new snapshot of the race detector, containing a fix that lets it handle mid-stack inlining correctly. Fixes #33309 Change-Id: I7551912a491f0615e77d069f198c1b8a6eead280 Reviewed-on: https://go-review.googlesource.com/c/go/+/201898 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-11-13cmd,runtime: enable race detector on arm64Fangming.Fang
Changes include: 1. enable compiler option -race for arm64 2. add runtime/race_arm64.s to manage the calls from Go to the compiler-rt runtime 3. change racewalk.go to call racefuncenterfp instead of racefuncenter on arm64 to allow the caller pc to be obtained in the asm code before calling the tsan version 4. race_linux_arm64.syso comes from compiler-rt which just supports 48bit VA, compiler-rt is fetched from master branch which latest commit is 3aa2b775d08f903f804246af10b Fixes #25682 Change-Id: I04364c580b8157fd117deecae74a4656ba16e005 Reviewed-on: https://go-review.googlesource.com/c/138675 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2018-06-04runtime/race: update most syso files to compiler-rt fe2c72Bryan C. Mills
These were generated using the racebuild configuration from https://golang.org/cl/115375, with the LLVM compiler-rt repository at commit fe2c72c59aa7f4afa45e3f65a5d16a374b6cce26 for most platforms. The Windows build is from an older compiler-rt revision, because the compiler-rt build script for the Go race detector has been broken since January 2017 (https://reviews.llvm.org/D28596). Updates #24354. Change-Id: Ica05a5d0545de61172f52ab97e7f8f57fb73dbfd Reviewed-on: https://go-review.googlesource.com/112896 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-10-30runtime/race: update race runtimeDmitry Vyukov
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 <dvyukov@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-07-20runtime/race: fix memory leakDmitry Vyukov
The leak was reported internally on a sever canary that runs for days. After a day server consumes 5.6GB, after 6 days -- 12.2GB. The leak is exposed by the added benchmark. The leak is fixed upstream in : http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_thread.cc?view=diff&r1=276102&r2=276103&pathrev=276103 Fixes #16441 Change-Id: I9d4f0adef48ca6cf2cd781b9a6990ad4661ba49b Reviewed-on: https://go-review.googlesource.com/25091 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
2016-05-03runtime: per-P contexts for race detectorDmitry Vyukov
Race runtime also needs local malloc caches and currently uses a mix of per-OS-thread and per-goroutine caches. This leads to increased memory consumption. But more importantly cache of synchronization objects is per-goroutine and we don't always have goroutine context when feeing memory in GC. As the result synchronization object descriptors leak (more precisely, they can be reused if another synchronization object is recreated at the same address, but it does not always help). For example, the added BenchmarkSyncLeak has effectively runaway memory consumption (based on a real long running server). This change updates race runtime with support for per-P contexts. BenchmarkSyncLeak now stabilizes at ~1GB memory consumption. Long term, this will allow us to remove race runtime dependency on glibc (as malloc is the main cornerstone). I've also implemented a different scheme to pass P context to race runtime: scheduler notified race runtime about association between G and P by calling procwire(g, p)/procunwire(g, p). But it turned out to be very messy as we have lots of places where the association changes (e.g. syscalls). So I dropped it in favor of the current scheme: race runtime asks scheduler about the current P. Fixes #14533 Change-Id: Iad10d2f816a44affae1b9fed446b3580eafd8c69 Reviewed-on: https://go-review.googlesource.com/19970 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Dmitry Vyukov <dvyukov@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-11-12runtime/race: update race runtimeDmitry Vyukov
The new revision is 389d49d4943780efbfcd2a434f4462b6d0f23c44 (Nov 13, 2015). The runtimes are built using the new x/build/cmd/racebuild utility. This update fixes a bug in race detection algorithm that can lead to occasional false negatives (#10589). But generally just brings in an up-to-date runtime. Update #8653 Fixes #10589 Change-Id: I7ac9614d014ee89c2302ce5e096d326ef293f367 Reviewed-on: https://go-review.googlesource.com/16827 Reviewed-by: Keith Randall <khr@golang.org>
2015-02-20runtime/race: update race runtime to rev 229396Dmitry Vyukov
Fixes #9720 Fixes #8053 Fixes https://code.google.com/p/thread-sanitizer/issues/detail?id=89 Change-Id: I7d598e53de86586bb9702d8e9276a4d6aece2dfc Reviewed-on: https://go-review.googlesource.com/4950 Reviewed-by: Ian Lance Taylor <iant@golang.org>
2014-09-08build: move package sources from src/pkg to srcRuss Cox
Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg.