golang/src/runtime/race
Russ Cox 24fa7544b0 runtime: fix spurious race using Ticker.Reset
Ticker.Reset was added in CL 217362 in 2020.
It added the runtime helper modTimer, which is
analogous to startTimer and resetTimer but for tickers.
Unlike those, it does not contain a racerelease, which
means that code synchronizing by starting a ticker
will be diagnosed with a spurious race.

Add racerelease to modTimer and add tests of all
three racereleases (in startTimer, resetTimer, and modTimer).

Also do not call time.resetTimer from elsewhere in runtime,
since that function is only for package time. Use t.reset instead.

For #33184.

Change-Id: Ie40c1ad24911f21e81b1d3cc608cf086ff2bc83d
Reviewed-on: https://go-review.googlesource.com/c/go/+/568340
Auto-Submit: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2024-03-08 22:34:15 +00:00
..
internal runtime/race: update race syso files to support atomic And, Or 2023-11-16 19:29:22 +00:00
testdata runtime: fix spurious race using Ticker.Reset 2024-03-08 22:34:15 +00:00
README runtime/race: update race syso for PPC64LE 2023-11-20 15:19:32 +00:00
doc.go runtime/race: do not use cgo on macOS 2022-11-16 21:38:55 +00:00
mkcgo.sh runtime/race: do not use cgo on macOS 2022-11-16 21:38:55 +00:00
output_test.go testing: use monotonic counts to attribute races in subtests 2023-10-25 20:44:25 +00:00
race.go runtime/race: do not use cgo on macOS 2022-11-16 21:38:55 +00:00
race_darwin_amd64.go runtime/race: update race syso files to support atomic And, Or 2023-11-16 19:29:22 +00:00
race_darwin_arm64.go runtime/race: update race syso files to support atomic And, Or 2023-11-16 19:29:22 +00:00
race_darwin_arm64.syso runtime/race: update race syso files to support atomic And, Or 2023-11-16 19:29:22 +00:00
race_linux_arm64.syso runtime/race: update race syso files to support atomic And, Or 2023-11-16 19:29:22 +00:00
race_linux_ppc64le.syso runtime/race: update race syso for PPC64LE 2023-11-20 15:19:32 +00:00
race_linux_s390x.syso runtime/race: update race syso files to support atomic And, Or 2023-11-16 19:29:22 +00:00
race_linux_test.go runtime: use 1-byte load for address checking in racecallatomic 2023-06-16 14:09:02 +00:00
race_test.go all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
race_unix_test.go runtime/race: also unmap memory if TestNonGoMemory fails 2022-09-09 15:36:26 +00:00
race_v1_amd64.go runtime/race: add build tag to internal amd64vN packages 2022-12-22 04:34:09 +00:00
race_v3_amd64.go runtime/race: add build tag to internal amd64vN packages 2022-12-22 04:34:09 +00:00
race_windows_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
sched_test.go runtime/race: use strings.Builder 2022-09-08 13:27:43 +00:00
syso_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00
timer_test.go all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor) 2021-10-28 18:17:57 +00:00

README

runtime/race package contains the data race detector runtime library.
It is based on ThreadSanitizer race detector, that is currently a part of
the LLVM project (https://github.com/llvm/llvm-project/tree/main/compiler-rt).

To update the .syso files use golang.org/x/build/cmd/racebuild.

internal/amd64v1/race_darwin.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 and Go e7d582b55dda36e76ce4d0ce770139ca0915b7c5.
internal/amd64v1/race_freebsd.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 and Go e7d582b55dda36e76ce4d0ce770139ca0915b7c5.
internal/amd64v1/race_linux.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 and Go e7d582b55dda36e76ce4d0ce770139ca0915b7c5.
internal/amd64v1/race_netbsd.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 and Go e7d582b55dda36e76ce4d0ce770139ca0915b7c5.
internal/amd64v1/race_openbsd.syso built with LLVM fcf6ae2f070eba73074b6ec8d8281e54d29dbeeb and Go 8f2db14cd35bbd674cb2988a508306de6655e425.
internal/amd64v1/race_windows.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 and Go e7d582b55dda36e76ce4d0ce770139ca0915b7c5.
internal/amd64v3/race_linux.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 and Go e7d582b55dda36e76ce4d0ce770139ca0915b7c5.
race_darwin_arm64.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 and Go e7d582b55dda36e76ce4d0ce770139ca0915b7c5.
race_linux_arm64.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 and Go e7d582b55dda36e76ce4d0ce770139ca0915b7c5.
race_linux_ppc64le.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 and Go e7d582b55dda36e76ce4d0ce770139ca0915b7c5.
race_linux_s390x.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 and Go e7d582b55dda36e76ce4d0ce770139ca0915b7c5.