tsan: capture shadow map start/end on init and reuse in reset
authorThan McIntosh <thanm@google.com>
Thu, 30 Jun 2022 13:31:17 +0000 (09:31 -0400)
committerThan McIntosh <thanm@google.com>
Tue, 26 Jul 2022 14:04:39 +0000 (10:04 -0400)
commitb6374437af39af66896da74a1dc1b8a0ece26bee
tree3aa291eba201c5f2ed99d095c781c07bdb72c379
parentf2b7f18e6375bb7eb6232f35c9ca30da8e20d7c7
tsan: capture shadow map start/end on init and reuse in reset

Capture the computed shadow begin/end values at the point where the
shadow is first created and reuse those values on reset. Introduce new
windows-specific function "ZeroMmapFixedRegion" for zeroing out an
address space region previously returned by one of the MmapFixed*
routines; call this function (on windows) from DoResetImpl
tsan_rtl.cpp instead of MmapFixedSuperNoReserve.

See https://github.com/golang/go/issues/53539#issuecomment-1168778740
for context; intended to help with updating the syso for Go's
windows/amd64 race detector.

Differential Revision: https://reviews.llvm.org/D128909
compiler-rt/lib/sanitizer_common/sanitizer_common.h
compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
compiler-rt/lib/tsan/go/build.bat
compiler-rt/lib/tsan/rtl/tsan_platform.h
compiler-rt/lib/tsan/rtl/tsan_rtl.cpp
compiler-rt/lib/tsan/rtl/tsan_rtl.h