]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.4] runtime: fix atomic operations on non-heap addresses
authorRuss Cox <rsc@golang.org>
Thu, 20 Nov 2014 15:14:49 +0000 (10:14 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 20 Nov 2014 15:14:49 +0000 (10:14 -0500)
commit791fec05e4505af1bfac30a79170315ad02a6d90
treed1c3a05585b413b2b8af47e4d4c6f7078ca0fbee
parenta791780bfd8a5841b8c3a80d5e149bd6f02850a3
[release-branch.go1.4] runtime: fix atomic operations on non-heap addresses

««« CL 179030043 / e4ab8f908aac
runtime: fix atomic operations on non-heap addresses
Race detector runtime does not tolerate operations on addresses
that was not previously declared with __tsan_map_shadow
(namely, data, bss and heap). The corresponding address
checks for atomic operations were removed in
https://golang.org/cl/111310044
Restore these checks.
It's tricker than just not calling into race runtime,
because it is the race runtime that makes the atomic
operations themselves (if we do not call into race runtime
we skip the atomic operation itself as well). So instead we call
__tsan_go_ignore_sync_start/end around the atomic operation.
This forces race runtime to skip all other processing
except than doing the atomic operation itself.
Fixes #9136.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/179030043

»»»

TBR=dvyukov
CC=golang-codereviews
https://golang.org/cl/180030043
src/runtime/race.c
src/runtime/race/race_unix_test.go [new file with mode: 0644]
src/runtime/race_amd64.s