mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: setg after sigFetchG
In the normal case, sigFetchG just returns the G register. But in the case that sigFetchG fetches the G from somewhere else, the G register still holding an invalid value. Setg here to make sure they match. This is particularly useful because setGsignalStack, called by adjustSignalStack from sigtrampgo before setg to gsignal, accesses the G register. Should fix #35249. Change-Id: I64c85143cb05cdb2ecca7f9936dbd8bfec186c2d Reviewed-on: https://go-review.googlesource.com/c/go/+/204441 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
c3cef0bfe5
commit
fb05264fe1
1 changed files with 1 additions and 0 deletions
|
|
@ -394,6 +394,7 @@ func sigtrampgo(sig uint32, info *siginfo, ctx unsafe.Pointer) {
|
|||
}
|
||||
c := &sigctxt{info, ctx}
|
||||
g := sigFetchG(c)
|
||||
setg(g)
|
||||
if g == nil {
|
||||
if sig == _SIGPROF {
|
||||
sigprofNonGoPC(c.sigpc())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue