-
Notifications
You must be signed in to change notification settings - Fork 18k
Test failure in test/finprofiled.go --- integer divide by zero #64153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Marking as release-blocker since that is a significant change during the Go 1.22 development cycle. |
This is odd. The negative bytes suggests an accounting error for the alloc header. I'll take a look. |
OK there's a fairly clear (to me) accounting error for memory profiles specifically. That explains the -8 and it's easy to fix. However, I do think that this code can correctly end up having 0 objects for an individual memprofile record (which represents allocations for a particular stack trace), so there's an issue with the test. |
Change https://go.dev/cl/542735 mentions this issue: |
Change https://go.dev/cl/542736 mentions this issue: |
Currently the final size computed for an object in mallocgc excludes the allocation header. This is correct in a number of cases, but definitely wrong for memory profiling because the "free" side accounts for the full allocation slot. This change makes an explicit distinction between the parts of mallocgc that care about the full allocation slot size ("the GC's accounting") and those that don't (pointer+len should always be valid). It then applies the appropriate size to the different forms of accounting in mallocgc. For #64153. Change-Id: I481b34b2bb9ff923b59e8408ab2b8fb9025ba944 Reviewed-on: https://go-review.googlesource.com/c/go/+/542735 LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Michael Knyszek <[email protected]> Reviewed-by: Cherry Mui <[email protected]>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
run
all.bash
, or rungo test cmd/internal/testdir -run Test/finprofiled.go
What did you expect to see?
All tests pass
What did you see instead?
Some thoughts:
I'm not very familiar with GC and memory profiler, but in finprofiled.go:60, the code truly does not check the value of
nobj
:I try to reproduce it in other machines(x86, darwin/arm64) but it only occurs on my arm64 container. So I have to say I can't make sure whether it's caused by my container or it's just a simple bug. Here are some info I just collected:
I git bisect and it points at CL 538217
Here is the log if I uncomment the
println
:The text was updated successfully, but these errors were encountered: