Comments (9)
I think I found the bug. The span can be freed (and the "bytes in heap" stats can be updated) before we update the object stats for large objects on sweep. The subtraction assumes that object stats are always handled before the "bytes in heap" stat.
from go.
I've checked and think I can rule out arena usage. There are no search hits for arena imports in our mono-repo, and we're seeing this issue across most of our services.
Any other ideas for things we could do to help debug this? Do you have a chance to see if the issue happens with Google's fleet? It's possible we're doing something weird, but I'm not sure what 🤔 . This is the only memory metric that we see behave oddly like this.
from go.
Hm... those differences are so large (300+ MiB??) that it doesn't seem like a situation where we're transiently racy in some corner case (as is the usual case for accounting bugs). It's a bit difficult to explain this.
This is a shot in the dark, but is it possible these services are using GOEXPERIMENT=arenas
? That's maybe the one area where I could see both (1) skew this large and (2) accounting bugs still lurk, because it's used less widely.
from go.
Change https://go.dev/cl/583380 mentions this issue: runtime: update large object stats before freeSpan in sweep
from go.
@gopherbot Please open backport issues for Go 1.21 and Go 1.22.
This issue can cause spurious overflow in runtime metrics with no workaround.
from go.
Backport issue(s) opened: #67187 (for 1.21), #67188 (for 1.22).
Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.
from go.
Reproducer:
package main
import (
"runtime/metrics"
)
var sink any
func main() {
go func() {
s := []metrics.Sample{
{Name: "/memory/classes/heap/unused:bytes"},
}
for {
metrics.Read(s)
val := s[0].Value.Uint64()
if val > 1<<40 {
panic("overflow")
}
}
}()
for {
sink = make([]byte, 10<<20)
sink = nil
}
}
from go.
Change https://go.dev/cl/584337 mentions this issue: [relase-branch.go1.21] runtime: update large object stats before freeSpan in sweep
from go.
Change https://go.dev/cl/584339 mentions this issue: [relase-branch.go1.22] runtime: update large object stats before freeSpan in sweep
from go.
Related Issues (20)
- go/types, types2: audit type assertions for potential Alias bugs HOT 12
- runtime: MutexProfile has multiple records with equal stack HOT 3
- x/tools/gopls: set GODEBUG=gotypesalias=0 in [email protected]
- x/tools/gopls: update x/telemetry dependency in [email protected] HOT 1
- proposal: cross-platform network frame communications package HOT 6
- proposal: weak: new package providing weak pointers HOT 5
- archive/zip: EOCDR comment length handling is inconsistent with other ZIP implementations [1.21 backport] HOT 1
- archive/zip: EOCDR comment length handling is inconsistent with other ZIP implementations [1.22 backport] HOT 1
- net/http: `expect: 100-continue` handling is broken in various ways HOT 1
- cmd/internal/testdir: Test/rangegen.go failures HOT 1
- x/tools/gopls/internal/test/integration/codelens: TestGCDetails_Toggle/default failures HOT 1
- cmd/internal/testdir: Test/fixedbugs/issue46234.go failures HOT 1
- cmd/internal/testdir: Test/fixedbugs/issue21576.go failures HOT 2
- build: runtime failures HOT 2
- x/vuln: TestMisspell failures HOT 2
- proposal: cmd/go: allow unicode in module paths and file names HOT 2
- runtime/pprof: TestMutexProfileRateAdjust failures HOT 3
- cmd/cgo/internal/testcarchive: TestManyCalls failures HOT 2
- x/pkgsite: package removal request for github.com/flc1125/go-twca/mid
- proposal: testing: add testing.T.Volatile to exempt test functions from result caching HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go.