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: morestack_noctxt missing SPWRITE, causes "traceback stuck" assert [1.18 backport] #54674

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

Comments

@gopherbot
Copy link

@cherrymui requested issue #54332 to be considered for backport to the next 1.18 minor release.

@gopherbot please backport this to previous releases. This may cause a runtime crash. Thanks.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Aug 25, 2022
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Aug 25, 2022
@gopherbot gopherbot added this to the Go1.18.6 milestone Aug 25, 2022
@gopherbot
Copy link
Author

Change https://go.dev/cl/425616 mentions this issue: [release-branch.go1.18] runtime: mark morestack_noctxt SPWRITE on LR architectures

@heschi heschi added the CherryPickApproved Used during the release process for point releases label Aug 31, 2022
@gopherbot gopherbot removed the CherryPickCandidate Used during the release process for point releases label Aug 31, 2022
gopherbot pushed a commit that referenced this issue Aug 31, 2022
…architectures

On LR architectures, morestack (and morestack_noctxt) are called
with a special calling convention, where the caller doesn't save
LR on stack but passes it as a register, which morestack will save
to g.sched.lr. The stack unwinder currently doesn't understand it,
and would fail to unwind from it. morestack already writes SP (as
it switches stack), but morestack_noctxt (which tailcalls
morestack) doesn't. If a profiling signal lands right in
morestack_noctxt, the unwinder will try to unwind the stack and
go off, and possibly crash.

Marking morestack_noctxt SPWRITE stops the unwinding.

Ideally we could teach the unwinder about the special calling
convention, or change the calling convention to be less special
(so the unwinder doesn't need to fetch a register from the signal
context). This is a stop-gap solution, to stop the unwinder from
crashing.

Updates #54332.
Fixes #54674.

Change-Id: I75295f2e27ddcf05f1ea0b541aedcb9000ae7576
Reviewed-on: https://go-review.googlesource.com/c/go/+/425396
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
(cherry picked from commit e4be2ac)
Reviewed-on: https://go-review.googlesource.com/c/go/+/425616
@gopherbot
Copy link
Author

Closed by merging 889d326 to release-branch.go1.18.

@golang golang locked and limited conversation to collaborators Aug 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved Used during the release process for point releases compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

2 participants