Commit e42413ce authored by Austin Clements's avatar Austin Clements

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/12125Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
parent edfc9797
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment