aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/string.go
diff options
context:
space:
mode:
authorDerek Parker <parkerderek86@gmail.com>2026-02-23 11:53:35 -0800
committerGopher Robot <gobot@golang.org>2026-02-27 12:43:37 -0800
commit76222756d9674a41b01a11d123ce39a7b26eb7fc (patch)
treec4eb92d6a2d2f3e8ecc7f39f71e09d5c87d59bef /src/runtime/string.go
parentf2633386e0d2f692b4363134626f472fc95b9858 (diff)
downloadgo-76222756d9674a41b01a11d123ce39a7b26eb7fc.tar.xz
cmd/compile: gate instrumentEnterExit on NoRaceFunc check
The NoRaceFunc flag is meant to suppress racefuncenter/racefuncexit instrumentation for packages like internal/runtime/atomic. However, instrumentEnterExit was set unconditionally when -race was enabled, outside the NoRaceFunc guard. This caused generic functions from NoRaceFunc packages (e.g. atomic.(*Pointer[T]).Store) to receive racefuncenter calls when instantiated in other packages, leading to a segfault during early runtime init before the race runtime is ready. Move the instrumentEnterExit assignment inside the NoRaceFunc check so both memory and enter/exit instrumentation are suppressed together. Fixes #77597 Change-Id: Id03bb9c422d36e2e88ecdf165ad3b1a4700a935c Reviewed-on: https://go-review.googlesource.com/c/go/+/748260 Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/runtime/string.go')
0 files changed, 0 insertions, 0 deletions