go/src
Austin Clements e2bb03f175 runtime: don't install a stack barrier in cgocallback_gofunc's frame
Currently the runtime can install stack barriers in any frame.
However, the frame of cgocallback_gofunc is special: it's the one
function that switches from a regular G stack to the system stack on
return. Hence, the return PC slot in its frame on the G stack is
actually used to save getg().sched.pc (so tracebacks appear to unwind
to the last Go function running on that G), and not as an actual
return PC for cgocallback_gofunc.

Because of this, if we install a stack barrier in cgocallback_gofunc's
return PC slot, when cgocallback_gofunc does return, it will move the
stack barrier stub PC in to getg().sched.pc and switch back to the
system stack. The rest of the runtime doesn't know how to deal with a
stack barrier stub in sched.pc: nothing knows how to match it up with
the G's stack barrier array and, when the runtime removes stack
barriers, it doesn't know to undo the one in sched.pc. Hence, if the C
code later returns back in to Go code, it will attempt to return
through the stack barrier saved in sched.pc, which may no longer have
correct unwinding information.

Fix this by blacklisting cgocallback_gofunc's frame so the runtime
won't install a stack barrier in it's return PC slot.

Fixes #12238.

Change-Id: I46aa2155df2fd050dd50de3434b62987dc4947b8
Reviewed-on: https://go-review.googlesource.com/13944
Reviewed-by: Russ Cox <rsc@golang.org>
2015-08-30 16:06:47 +00:00
..
archive archive/tar: don't treat multiple file system links as a tar hardlink 2015-08-04 17:34:43 +00:00
bufio
builtin
bytes bytes: improve Compare function on amd64 for large byte arrays 2015-08-26 03:52:20 +00:00
cmd cmd/compile/internal/gc: use slice instead of linked list for nodes to export 2015-08-28 22:49:15 +00:00
compress compress/gzip: clarify Latin-1 restrictions on gzip.Header 2015-08-28 22:05:53 +00:00
container
crypto crypto/x509: emit PKIX names in a more standard order. 2015-08-30 15:34:48 +00:00
database/sql
debug debug/elf: map/slice literals janitoring 2015-08-25 01:36:11 +00:00
encoding encoding/asn1: fix panic when Marshaling nil. 2015-08-29 18:53:41 +00:00
errors
expvar
flag
fmt fmt: in Scanf, %c can scan a space, so don't skip spaces at %c 2015-08-24 20:25:07 +00:00
go go/types: fix real(a) and imag(a) for untyped arguments 2015-08-26 21:16:31 +00:00
hash hash/fnv: fix wiki url 2015-08-24 21:26:42 +00:00
html html: speed up UnescapeString 2015-08-22 12:45:38 +00:00
image image/gif: avoid unused assignment 2015-08-24 16:17:42 +00:00
index/suffixarray
internal registry: Explain how GetMUIStringValue works and where it falls short 2015-08-28 05:41:29 +00:00
io
log
math math/big: use optimized formula in ModSqrt for 3 mod 4 primes 2015-08-29 19:11:03 +00:00
mime mime: move examples to external test file 2015-08-22 18:39:29 +00:00
net net: restore LookupPort for integer strings 2015-08-27 16:17:21 +00:00
os os/signal: skip the nohup test on darwin when running in tmux. 2015-08-25 00:14:24 +00:00
path all: fix some vet-caught formatting errors, mostly but not only in tests 2015-08-21 05:37:36 +00:00
reflect cmd/compile, cmd/link, reflect, runtime: remove type.zero field 2015-08-26 00:28:17 +00:00
regexp
runtime runtime: don't install a stack barrier in cgocallback_gofunc's frame 2015-08-30 16:06:47 +00:00
sort sort: Fix typo in Stable() comment 2015-08-17 06:58:16 +00:00
strconv
strings
sync runtime, sync/atomic: add memory barriers in arm cas routines 2015-07-30 20:11:11 +00:00
syscall syscall: remove nacl srpc helper 2015-08-28 04:44:44 +00:00
testing testing/quick: terminate for arbitrary recursive types 2015-08-29 19:23:37 +00:00
text text/template: add ExecError type and return it from Execute on error 2015-08-27 06:40:56 +00:00
time time: fix 400 year offset in comment 2015-08-29 01:03:42 +00:00
unicode unicode: include rune 0 in RangeTables. 2015-08-24 15:05:48 +00:00
unsafe
Make.dist
all.bash
all.bat
all.rc
androidtest.bash
bootstrap.bash
buildall.bash
clean.bash build: clean current tree in clean.bash 2015-08-05 19:36:15 +00:00
clean.bat
clean.rc
iostest.bash
make.bash make.bash: abort if $GOROOT_BOOTSTRAP == $GOROOT 2015-08-24 03:04:52 +00:00
make.bat
make.rc
nacltest.bash
race.bash
race.bat
run.bash
run.bat
run.rc