Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: crash in race detector when execution tracer reads from CPU profile buffer [1.22 backport] #65644

Closed
gopherbot opened this issue Feb 9, 2024 · 2 comments
Labels
CherryPickApproved Used during the release process for point releases compiler/runtime Issues related to the Go compiler and/or runtime.
Milestone

Comments

@gopherbot
Copy link

@prattmic requested issue #65607 to be considered for backport to the next 1.22 minor release.

@gopherbot Please backport to 1.22. This causes random crashes when using race+trace+cpu profiling.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Feb 9, 2024
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Feb 9, 2024
@gopherbot gopherbot added this to the Go1.22.1 milestone Feb 9, 2024
@gopherbot
Copy link
Author

Change https://go.dev/cl/562559 mentions this issue: [release-branch.go1.22] runtime: don't call traceReadCPU on the system stack

@thanm thanm added CherryPickApproved Used during the release process for point releases and removed CherryPickCandidate Used during the release process for point releases labels Feb 14, 2024
gopherbot pushed a commit that referenced this issue Feb 16, 2024
…m 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.

For #65607.
Fixes #65644.

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>
(cherry picked from commit 9fa153b)
Reviewed-on: https://go-review.googlesource.com/c/go/+/562559
@gopherbot
Copy link
Author

Closed by merging 6fbd01a to release-branch.go1.22.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CherryPickApproved Used during the release process for point releases compiler/runtime Issues related to the Go compiler and/or runtime.
Projects
None yet
Development

No branches or pull requests

2 participants