]> Cypherpunks repositories - gostls13.git/commit
runtime: don't call traceReadCPU on the system stack
authorMichael Pratt <mpratt@google.com>
Fri, 9 Feb 2024 18:49:21 +0000 (13:49 -0500)
committerGopher Robot <gobot@golang.org>
Fri, 9 Feb 2024 20:07:38 +0000 (20:07 +0000)
commit9fa153b729969855fcb694e12c16e20b1407ed9c
tree6347c4517107f32d747b22dd22dcbb6b5b8ec62e
parent532c6f1c8d724975f578c8ec519f1f5b07d949da
runtime: don't call traceReadCPU on the system stack

traceReadCPU calls profBuf.read, which does a raceacquire. g0 does not
have a race context, so this crashes when running on the system stack.

We could borrow a race context, but it is simpler to just move
traceReadCPU off of the system stack.

Fixes #65607.

Change-Id: I335155b96d683aebb92b2f4e1eea063dd139f2d5
Reviewed-on: https://go-review.googlesource.com/c/go/+/562996
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/runtime/trace2.go
src/runtime/trace2cpu.go