1
0
mirror of https://github.com/golang/go synced 2024-11-19 12:54:45 -07:00
go/src/runtime/cgo
Bryan C. Mills e0545faf27 runtime/cgo: defeat inlining in x_cgo_yield
We use a call to strncpy to work around a TSAN bug (wherein TSAN only
delivers asynchronous signals when the thread receiving the signal
calls a libc function). Unfortunately, GCC 7 inlines the call,
avoiding the TSAN libc trap entirely.

Per Ian's suggestion, use global variables as strncpy arguments: that
way, the compiler can't make any assumptions about the concrete values
and can't inline the call away.

fixes #21196

Change-Id: Ie95f1feaf9af1a8056f924f49c29cfc8515385d7
Reviewed-on: https://go-review.googlesource.com/55872
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-08-16 18:49:38 +00:00
..
asm_386.s
asm_amd64.s
asm_arm64.s
asm_arm.s
asm_mips64x.s
asm_mipsx.s runtime: add cgo support for GOARCH=mips{,le} 2016-12-14 23:52:33 +00:00
asm_nacl_amd64p32.s
asm_ppc64x.s runtime: save and restore CR for ppc64le 2017-06-05 19:59:49 +00:00
asm_s390x.s
callbacks_traceback.go
callbacks.go runtime: poll libc to deliver signals under TSAN 2017-03-08 18:58:30 +00:00
cgo.go
dragonfly.go
freebsd.go
gcc_386.S
gcc_amd64.S
gcc_android_386.c runtime/cgo: make code robust 2017-08-11 18:51:24 +00:00
gcc_android_amd64.c runtime/cgo: make code robust 2017-08-11 18:51:24 +00:00
gcc_android_arm64.c runtime/cgo: raise the thread-local storage slot search limit on Android 2017-03-27 08:56:08 +00:00
gcc_android_arm.c runtime/cgo: raise the thread-local storage slot search limit on Android 2017-03-27 08:56:08 +00:00
gcc_android.c
gcc_arm64.S
gcc_arm.S
gcc_context.c
gcc_darwin_386.c runtime/cgo: make code robust 2017-08-11 18:51:24 +00:00
gcc_darwin_amd64.c runtime/cgo: make code robust 2017-08-11 18:51:24 +00:00
gcc_darwin_arm64.c runtime/cgo: fix typos 2017-06-21 15:54:38 +00:00
gcc_darwin_arm.c runtime/cgo: fix typos 2017-06-21 15:54:38 +00:00
gcc_dragonfly_amd64.c runtime/cgo: fix typos 2017-06-21 15:54:38 +00:00
gcc_fatalf.c
gcc_freebsd_386.c runtime/cgo: fix typos 2017-06-21 15:54:38 +00:00
gcc_freebsd_amd64.c runtime/cgo: fix typos 2017-06-21 15:54:38 +00:00
gcc_freebsd_arm.c runtime/cgo: fix typos 2017-06-21 15:54:38 +00:00
gcc_libinit_windows.c
gcc_libinit.c cmd/link,runtime/cgo: enable PT_TLS generation on OpenBSD 2017-04-11 16:33:16 +00:00
gcc_linux_386.c runtime/cgo: fix typos 2017-06-21 15:54:38 +00:00
gcc_linux_amd64.c runtime/cgo: fix typos 2017-06-21 15:54:38 +00:00
gcc_linux_arm64.c runtime/cgo: fix typos 2017-06-21 15:54:38 +00:00
gcc_linux_arm.c runtime/cgo: fix typos 2017-06-21 15:54:38 +00:00
gcc_linux_mips64x.c runtime/cgo: fix typos 2017-06-21 15:54:38 +00:00
gcc_linux_mipsx.c runtime/cgo: fix typos 2017-06-21 15:54:38 +00:00
gcc_linux_ppc64x.c runtime/cgo: fix typos 2017-06-21 15:54:38 +00:00
gcc_linux_s390x.c runtime/cgo: fix typos 2017-06-21 15:54:38 +00:00
gcc_mips64x.S
gcc_mipsx.S runtime: add cgo support for GOARCH=mips{,le} 2016-12-14 23:52:33 +00:00
gcc_mmap.c runtime: intercept munmap as we do mmap 2017-06-06 23:26:55 +00:00
gcc_netbsd_386.c runtime/cgo: fix typos 2017-06-21 15:54:38 +00:00
gcc_netbsd_amd64.c runtime/cgo: fix typos 2017-06-21 15:54:38 +00:00
gcc_netbsd_arm.c runtime/cgo: fix typos 2017-06-21 15:54:38 +00:00
gcc_openbsd_386.c runtime/cgo: fix typos 2017-06-21 15:54:38 +00:00
gcc_openbsd_amd64.c runtime/cgo: fix typos 2017-06-21 15:54:38 +00:00
gcc_ppc64x.S
gcc_s390x.S
gcc_setenv.c
gcc_sigaction.c runtime/cgo: add TSAN annotations for C sigaction call 2017-05-26 16:34:43 +00:00
gcc_signal_darwin_armx.c
gcc_signal_darwin_lldb.c
gcc_solaris_amd64.c
gcc_traceback.c
gcc_util.c runtime/cgo: defeat inlining in x_cgo_yield 2017-08-16 18:49:38 +00:00
gcc_windows_386.c
gcc_windows_amd64.c
iscgo.go
libcgo_unix.h runtime/cgo: retry pthread_create on EAGAIN for OpenBSD 2016-12-05 21:15:05 +00:00
libcgo.h cmd/cgo, runtime/cgo: add docs for TSAN interaction 2017-05-26 05:22:39 +00:00
mmap.go runtime: intercept munmap as we do mmap 2017-06-06 23:26:55 +00:00
netbsd.go
openbsd.go cmd/link,runtime/cgo: enable PT_TLS generation on OpenBSD 2017-04-11 16:33:16 +00:00
setenv.go
sigaction.go
signal_darwin_arm64.s
signal_darwin_arm.s
signal_darwin_armx.go