commit | bb004a179a034c799809f42d525801ec4a791987 | [log] [tgz] |
---|---|---|
author | Michael Pratt <mpratt@google.com> | Thu Feb 24 16:54:13 2022 -0500 |
committer | Gopher Robot <gobot@golang.org> | Thu Apr 21 22:10:49 2022 +0000 |
tree | 3d52dbf47edbaa3e456a5c10e4a26018816de921 | |
parent | 889a902d215c57fe2032181370a9a2c30c531c99 [diff] |
syscall: define Syscall in terms of RawSyscall on linux This is a re-do of CL 388477, fixing #52472. It is unsafe to call syscall.RawSyscall from syscall.Syscall with -coverpkg=all and -race. This is because: 1. Coverage adds a sync/atomic call in RawSyscall to increment the coverage counter. 2. Race mode instruments sync/atomic calls with TSAN runtime calls. TSAN eventually calls runtime.racecallbackfunc, which expects getg().m.p != 0, which is no longer true after entersyscall(). cmd/go actually avoids adding coverage instrumention to package runtime in race mode entirely to avoid these kinds of problems. Rather than also excluding all of syscall for this one function, work around by calling RawSyscall6 instead, which avoids coverage instrumention both by being written in assembly and in package runtime/*. For #51087 Fixes #52472 Change-Id: Iaffd27df03753020c4716059a455d6ca7b62f347 Reviewed-on: https://go-review.googlesource.com/c/go/+/401654 Run-TryBot: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Michael Pratt <mpratt@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Official binary distributions are available at https://go.dev/dl/.
After downloading a binary release, visit https://go.dev/doc/install for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://go.dev/doc/install/source for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.