aboutsummaryrefslogtreecommitdiff
path: root/src/math/bits
diff options
context:
space:
mode:
authorMichael Matloob <matloob@golang.org>2024-12-03 15:09:41 -0500
committerMichael Matloob <matloob@golang.org>2024-12-04 18:20:54 +0000
commit61232096579d8801cb3513c84a97c141d50ad242 (patch)
tree66cc52e526d1cfb67f029092dfca01c5b92a15da /src/math/bits
parent6f42fe914169ef237423fb07e9c8321884b58c23 (diff)
downloadgo-61232096579d8801cb3513c84a97c141d50ad242.tar.xz
cmd/go/internal/cache: always check error from stat in markUsed
markUsed was not checking that the error from os.Stat was nil before trying to access the FileInfo entry returned by it. Instead, always check the error and return false if it's non-nil (usually because the file does not exist). This can happen if an index entry exists in the cache, but the output entry it points to does not. markUsed is called at different points for the index entry and for the output entry, so it's possible for the index entry to be marked used, and then for another go process to trim the cache, deleting the output entry. I'm not sure how likely that is, or if this is what has been triggering the user observed instances of #70600, but it's enough for a test case. Fixes #70600 Change-Id: Ia6be14b4a56736d06488ccf93c3596fff8159f22 Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest Reviewed-on: https://go-review.googlesource.com/c/go/+/633037 Reviewed-by: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/math/bits')
0 files changed, 0 insertions, 0 deletions