]> Cypherpunks repositories - gostls13.git/commit
runtime: use gcpc/gcsp during traceback of goroutines in syscalls
authorDmitriy Vyukov <dvyukov@google.com>
Tue, 6 Aug 2013 09:38:44 +0000 (13:38 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Tue, 6 Aug 2013 09:38:44 +0000 (13:38 +0400)
commit9c0500b466196388ab40e03c94759066bb1c7fe6
tree82ab2cf1ab628a0bc7da6e08917a8839f7ab8cee
parent321ede78e3fc432ff2f2ad5fb4babc4b45d82ed9
runtime: use gcpc/gcsp during traceback of goroutines in syscalls
gcpc/gcsp are used by GC in similar situation.
gcpc/gcsp are also more stable than gp->sched,
because gp->sched is mutated by entersyscall/exitsyscall
in morestack and mcall. So it has higher chances of being inconsistent.
Also, rename gcpc/gcsp to syscallpc/syscallsp.

This is the same as reverted change 12250043
with save marked as textflag 7.
The problem was that if save calls morestack,
then subsequent lessstack spoils g->sched.pc/sp.
And that bad values were remembered in g->syscallpc/sp.
Entersyscallblock had the same problem,
but it was never triggered to date.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12478043
src/pkg/runtime/mgc0.c
src/pkg/runtime/proc.c
src/pkg/runtime/runtime.h
src/pkg/runtime/traceback_arm.c
src/pkg/runtime/traceback_x86.c