mirror of
https://github.com/golang/go.git
synced 2026-02-07 02:09:55 +00:00
runtime: guard unexpected return pc gp.m dereference
If stack scanning reaches here while scanning a waiting goroutine, gp.m will be nil. We are going to crash anyway because the stack is corrupt, but we still want to reach the print below for context rather than dying with a SIGSEGV here. For #64030. Change-Id: I6a6a636c378669dc45972e1eb8e06401a0fed223 Reviewed-on: https://go-review.googlesource.com/c/go/+/726522 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>
This commit is contained in:
parent
bfb851c31e
commit
d2aad0df60
1 changed files with 1 additions and 1 deletions
|
|
@ -456,7 +456,7 @@ func (u *unwinder) next() {
|
|||
// get everything, so crash loudly.
|
||||
fail := u.flags&(unwindPrintErrors|unwindSilentErrors) == 0
|
||||
doPrint := u.flags&unwindSilentErrors == 0
|
||||
if doPrint && gp.m.incgo && f.funcID == abi.FuncID_sigpanic {
|
||||
if doPrint && gp.m != nil && gp.m.incgo && f.funcID == abi.FuncID_sigpanic {
|
||||
// We can inject sigpanic
|
||||
// calls directly into C code,
|
||||
// in which case we'll see a C
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue