1
0
mirror of https://github.com/golang/go synced 2024-11-17 02:54:45 -07:00
go/misc
Nikhil Benesch e496e612b7 runtime: never call into race detector with retaken P
cgocall could previously invoke the race detector on an M whose P had
been retaken. The race detector would attempt to use the P-local state
from this stale P, racing with the thread that was actually wired to
that P. The result was memory corruption of ThreadSanitizer's internal
data structures that presented as hard-to-understand assertion failures
and segfaults.

Reorder cgocall so that it always acquires a P before invoking the race
detector, and add a test that stresses the interaction between cgo and
the race detector to protect against future bugs of this kind.

Fixes #27660.

Change-Id: Ide93f96a23490314d6647547140e0a412a97f0d4
Reviewed-on: https://go-review.googlesource.com/c/148717
Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
2018-11-09 21:47:48 +00:00
..
android misc/android: forward SIGQUIT to the process running on the device 2018-05-23 18:18:39 +00:00
arm
cgo runtime: never call into race detector with retaken P 2018-11-09 21:47:48 +00:00
chrome/gophertool
git
ios misc/ios: remove note from output of detect.go 2018-10-24 15:33:31 +00:00
linkcheck
nacl cmd/vendor: update github.com/google/pprof 2018-11-07 12:27:21 +00:00
sortac
swig cmd/go: fix swig support and run swig tests during run.bash 2017-11-16 17:19:19 +00:00
trace misc/trace: update trace_viewer_full.html 2018-04-26 20:26:23 +00:00
wasm misc/wasm: improve detection of Node.js 2018-10-25 22:13:48 +00:00
benchcmp
editors