1
0
mirror of https://github.com/golang/go synced 2024-11-13 18:00:30 -07: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:
Austin Clements 2015-07-13 18:30:10 -04:00
parent edfc979725
commit e42413cecc

View File

@ -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