diff options
| author | Bryan C. Mills <bcmills@google.com> | 2017-08-07 19:30:03 -0400 |
|---|---|---|
| committer | Bryan Mills <bcmills@google.com> | 2017-08-16 18:49:38 +0000 |
| commit | e0545faf270fdbc0b3864db62f528eb36da3c63f (patch) | |
| tree | 1214c23536e085230a0e52238f832b843e128d97 /src/bytes | |
| parent | 58f84fdf29ca2f014a813991cf35e52de91a43cb (diff) | |
| download | go-e0545faf270fdbc0b3864db62f528eb36da3c63f.tar.xz | |
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>
Diffstat (limited to 'src/bytes')
0 files changed, 0 insertions, 0 deletions
