1
0
mirror of https://github.com/golang/go synced 2024-11-23 08:50:03 -07:00
go/misc/cgo/test
Keith Randall 1b6807bb06 cgo: adjust return value location to account for stack copies.
During a cgo call, the stack can be copied.  This copy invalidates
the pointer that cgo has into the return value area.  To fix this
problem, pass the address of the location containing the stack
top value (which is in the G struct).  For cgo functions which
return values, read the stktop before and after the cgo call to
compute the adjustment necessary to write the return value.

Fixes #8771

LGTM=iant, rsc
R=iant, rsc, khr
CC=golang-codereviews
https://golang.org/cl/144130043
2014-09-25 07:59:01 -07:00
..
backdoor cmd/go: prohibit C sources files unless using cgo 2014-09-24 15:10:38 -04:00
align.go test: Add the usual Copyright notice. 2012-01-24 14:48:15 -05:00
api.go misc/cgo/test: check API compatibility for cgo pseudo-functions 2013-05-30 02:59:57 +08:00
basic.go cgo: enable cgo on openbsd 2012-12-21 01:43:19 +11:00
buildid_linux.go cmd/go: pass --build-id=none when generating a cgo .o 2014-08-07 12:38:39 -07:00
callback_c_gc.c runtime: remove untyped allocation of ParFor 2014-09-16 11:03:11 -04:00
callback_c_gccgo.c runtime: remove untyped allocation of ParFor 2014-09-16 11:03:11 -04:00
callback_c.c cgo: adjust return value location to account for stack copies. 2014-09-25 07:59:01 -07:00
callback.go cgo: adjust return value location to account for stack copies. 2014-09-25 07:59:01 -07:00
cflags.go cmd/cgo, cmd/go: remove #cgo directive parsing from cmd/cgo 2013-04-10 21:41:54 -07:00
cgo_linux_test.go cmd/go: pass --build-id=none when generating a cgo .o 2014-08-07 12:38:39 -07:00
cgo_test.go cgo: adjust return value location to account for stack copies. 2014-09-25 07:59:01 -07:00
cthread_unix.c cgo: enable cgo on dragonfly 2013-09-04 15:19:21 -07:00
cthread_windows.c runtime: allow cgo callbacks on non-Go threads 2013-02-20 17:48:23 -05:00
cthread.go runtime: fix stack pointer corruption in runtime.cgocallback_gofunc() 2013-04-30 04:13:32 +08:00
duplicate_symbol.go cgo: omit duplicate symbols in writeDefs 2011-08-16 14:56:23 -04:00
env.go misc/cgo/test: make tests run on windows 2012-01-20 12:59:44 +11:00
exports.go runtime: remove untyped allocation of ParFor 2014-09-16 11:03:11 -04:00
fpvar.go cmd/cgo: Add support for C function pointers 2013-08-13 12:42:21 -04:00
helpers.go cgo: fix incorrect print found by govet 2011-11-29 14:40:34 +11:00
issue1222.go
issue1328.go misc/cgo: re-enable some tests 2012-03-06 23:27:30 -05:00
issue1560.go misc/cgo/test: deflake TestParallelSleep once more 2013-05-18 02:55:44 +08:00
issue1635.go cmd/ld: handle a special case of scattered relocation 2/1 on Darwin/386 2012-08-29 23:42:05 +08:00
issue2462.go cgo: support export for built-in types 2011-12-20 09:28:45 -08:00
issue3250.go misc/cgo/test: skip test for issue 3250, the runtime isn't ready yet. 2013-07-15 14:37:36 +08:00
issue3250w.go runtime: correctly handle signals received on foreign threads 2013-07-12 04:39:39 +08:00
issue3261.go cmd/go: new cgo build procedure 2012-08-17 03:42:34 +08:00
issue3729.go cmd/cgo: access errno from void C function 2012-12-18 00:26:08 +08:00
issue3729w.go cmd/cgo: access errno from void C function 2012-12-18 00:26:08 +08:00
issue3741.go cmd/cgo: generate definitions for GoSlice 2012-06-30 12:40:07 +08:00
issue3775.go misc/cgo/test: test recursive internal OS thread lock 2013-07-23 14:43:55 -04:00
issue3945.go runtime: increase stack frame during cgo call on windows/amd64 2012-09-03 12:12:51 +10:00
issue4029.go misc/cgo/test: do not stop on first error 2013-03-06 15:03:28 -05:00
issue4029w.go misc/cgo/test: add -ldl to LDFLAGS on Linux, ignore issue4029 on windows (fix build) 2012-10-10 01:30:34 +08:00
issue4054a.go cgo: process DWARF info even when debug data is used for value 2012-09-20 13:20:33 +10:00
issue4054b.go cgo: process DWARF info even when debug data is used for value 2012-09-20 13:20:33 +10:00
issue4273.c cmd/ld: handle weak symbols 2012-10-30 23:58:43 +08:00
issue4273b.c cmd/ld: handle weak symbols 2012-10-30 23:58:43 +08:00
issue4339.c misc/cgo/test: test of issue 4339 2013-09-11 09:56:38 -04:00
issue4339.go misc/cgo/test: test of issue 4339 2013-09-11 09:56:38 -04:00
issue4339.h misc/cgo/test: test of issue 4339 2013-09-11 09:56:38 -04:00
issue4417.go cmd/cgo: access errno from void C function 2012-12-18 00:26:08 +08:00
issue4857.go cmd/cgo: using __typeof__(a->r) instead of putting invalid TYPE in "a->r = (const TYPE)" 2013-06-02 22:46:53 +08:00
issue5227.go misc/cgo/test: fix a gcc warning 2013-04-18 02:33:55 +08:00
issue5242.go cmd/cgo: fix default alignment for empty structs 2014-08-11 22:10:17 -07:00
issue5337.go misc/cgo/test: make test work with -linkmode=internal 2013-07-11 23:24:35 -04:00
issue5337w.go misc/cgo/test: add missing import 2013-05-15 15:34:47 +10:00
issue5548_c.c cmd/cgo: use intgo, not int, for string and slice structures 2013-05-23 22:51:07 -07:00
issue5548.go misc/cgo/test: make issue5548 test pickier 2014-09-05 14:59:09 -04:00
issue5603.go cmd/cgo: use gcc_struct attribute for packed structs to work around GCC PR52991. 2013-06-09 22:06:29 +08:00
issue5740.go cmd/ld: handle duplicate static symbols in COFF and Mach-O files. 2013-09-18 22:27:25 -04:00
issue5740a.c cmd/ld: handle duplicate static symbols in COFF and Mach-O files. 2013-09-18 22:27:25 -04:00
issue5740b.c cmd/ld: handle duplicate static symbols in COFF and Mach-O files. 2013-09-18 22:27:25 -04:00
issue5986.go cmd/go: fix missing __mingw_fprintf symbol for cgo on windows 2013-09-19 01:20:02 -04:00
issue6128.go cmd/cgo: fix Xcode 5 incompatibility for #defined expressions 2013-10-15 14:34:46 -04:00
issue6390.go cmd/cgo: fix build (missing file from earlier CL) 2013-09-16 14:21:54 -04:00
issue6472.go debug/dwarf: handle surprising clang encoding 2013-10-09 11:08:22 -04:00
issue6506.go misc/cgo/test: cut out non-standard functions 2013-10-15 14:25:29 -04:00
issue6612.go cmd/cgo: stop using compiler error message text to analyze C names 2013-10-18 15:56:25 -04:00
issue6833_c.c cmd/cgo: use __gcc_struct__ for go exported functions 2013-12-10 11:30:12 +11:00
issue6833.go cmd/cgo: use __gcc_struct__ for go exported functions 2013-12-10 11:30:12 +11:00
issue6997_linux.c runtime: co-exist with NPTL's pthread_cancel. 2014-01-09 09:34:04 -08:00
issue6997_linux.go runtime: co-exist with NPTL's pthread_cancel. 2014-01-09 09:34:04 -08:00
issue7234_test.go cmd/ld: fix bug with "runtime/cgo" in external link mode 2014-01-30 09:25:47 -08:00
issue7560.go cmd/cgo: omit misaligned struct fields, like we omit bitfields 2014-05-12 23:48:20 -04:00
issue7665.go cmd/gc: disable link-time copying of un-Go-initialized globals 2014-05-09 16:03:44 -04:00
issue7786.go cmd/cgo: given typedef struct S T, make C.T and C.struct_S interchangeable 2014-05-28 14:04:31 -04:00
issue7978.go runtime: keep g->syscallsp consistent after cgo->Go callbacks 2014-09-24 13:20:25 -04:00
issue8092.go cmd/{ld,link,objdump}, runtime, debug/gosym: move linker-defined symbols into runtime package 2014-08-27 20:15:05 -04:00
issue8148.go cmd/cgo: for typedef of untagged struct, use typedef name in C code 2014-06-05 10:42:03 -07:00
issue8331.h cmd/cgo: use same Go type for typedef to anonymous struct 2014-06-02 12:55:43 -07:00
issue8331a.go cmd/cgo: use same Go type for typedef to anonymous struct 2014-06-02 12:55:43 -07:00
issue8331b.go cmd/cgo: use same Go type for typedef to anonymous struct 2014-06-02 12:55:43 -07:00
issue8428.go misc/cgo/test: disable issue 8428 regress test on darwin 2014-08-28 22:40:57 -04:00
issue8441.go cmd/cgo: fix recursive type mapping 2014-08-05 18:16:56 -07:00
issue8694.go debug/dwarf: correct name for clang-generated complex type 2014-09-24 16:53:47 -04:00
setgid_linux.go misc/cgo/test: only run setgid test on GNU/Linux 2012-07-28 10:40:51 -07:00
sleep_windows_386.go cmd/go: new cgo build procedure 2012-08-17 03:42:34 +08:00