mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: fix saved PC/SP after safe-point function in syscall
Running a safe-point function on syscall entry uses systemstack() and hence clobbers g.sched.pc and g.sched.sp. Fix this by re-saving them after the systemstack, just like in the other uses of systemstack in reentersyscall. Change-Id: I47868a53eba24d81919fda56ef6bbcf72f1f922e Reviewed-on: https://go-review.googlesource.com/12125 Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
edfc979725
commit
e42413cecc
1 changed files with 1 additions and 0 deletions
|
|
@ -1831,6 +1831,7 @@ func reentersyscall(pc, sp uintptr) {
|
|||
if _g_.m.p.ptr().runSafePointFn != 0 {
|
||||
// runSafePointFn may stack split if run on this stack
|
||||
systemstack(runSafePointFn)
|
||||
save(pc, sp)
|
||||
}
|
||||
|
||||
_g_.m.syscalltick = _g_.m.p.ptr().syscalltick
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue