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: macOS-only segfault on 1.14+ with "split stack overflow" [1.14 backport] #41991

Closed
gopherbot opened this issue Oct 15, 2020 · 5 comments
Closed

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Oct 15, 2020

@KSerrania requested issue #39079 to be considered for backport to the next 1.14 minor release.

@gopherbot please consider this for backport in 1.14. The issue can cause runtime crashes on MacOS, and there doesn't seem to be any reasonable workaround.

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Oct 15, 2020

Change https://golang.org/cl/262557 mentions this issue: [release-branch.go1.14] runtime: set g to gsignal before adjustSignalStack

@toothrot
Copy link
Contributor

@toothrot toothrot commented Oct 15, 2020

Approved. This is a serious issue with no workaround.

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Oct 15, 2020

Closed by merging fa44af7 to release-branch.go1.14.

@gopherbot gopherbot closed this Oct 15, 2020
gopherbot pushed a commit that referenced this issue Oct 15, 2020
…Stack

When a signal is received, the runtime probes whether an
alternate signal stack is set, if so, adjust gsignal's stack to
point to the alternate signal stack. This is done in
adjustSignalStack, which calls sigaltstack "syscall", which is a
libc call on darwin through asmcgocall. asmcgocall decides
whether to do stack switch based on whether we're running on g0
stack, gsignal stack, or regular g stack. If g is not set to
gsignal, asmcgocall may make wrong decision. Set g first.
adjustSignalStack is recursively nosplit, so it is okay that
temporarily gsignal.stack doesn't match the stack we're running
on.

Updates #39079.
Fixes #41991.

Change-Id: I59b2c5dc08c3c951f1098fff038bf2e06d7ca055
Reviewed-on: https://go-review.googlesource.com/c/go/+/238020
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
(cherry picked from commit d286e61)
Reviewed-on: https://go-review.googlesource.com/c/go/+/262557
Trust: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
@albertvaka
Copy link

@albertvaka albertvaka commented Oct 22, 2020

@toothrot any chance we get a new 1.14 minor release with this?

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Oct 22, 2020

@albertvaka New minor releases happen around the start of each month.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.