]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.22] runtime: hold traceAcquire across casgstatus in injectglist
authorMichael Anthony Knyszek <mknyszek@google.com>
Mon, 23 Dec 2024 17:21:07 +0000 (17:21 +0000)
committerGopher Robot <gobot@golang.org>
Wed, 8 Jan 2025 17:58:22 +0000 (09:58 -0800)
commitae9996f96510b105f478a426cd83cfac7b83c4e3
treea4899ba338133953ac5779bbe893c318df439a64
parent223260bc63bfc1a3120face5bbc49285f6c32357
[release-branch.go1.22] runtime: hold traceAcquire across casgstatus in injectglist

Currently injectglist emits all the trace events before actually calling
casgstatus on each goroutine. This is a problem, since tracing can
observe an inconsistent state (gstatus does not match tracer's 'emitted
an event' state).

This change fixes the problem by having injectglist do what every other
scheduler function does, and that's wrap each call to casgstatus in
traceAcquire/traceRelease.

For #70883.
Fixes #71146.

Change-Id: I857e96cec01688013597e8efc0c4c3d0b72d3a70
Reviewed-on: https://go-review.googlesource.com/c/go/+/638558
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
(cherry picked from commit f025d19e7b3f0c66242760c213cc2b54cb100f69)
Reviewed-on: https://go-review.googlesource.com/c/go/+/641356
Auto-Submit: Michael Pratt <mpratt@google.com>
src/runtime/proc.go