-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
runtime: MutexProfile has multiple records with equal stack #67548
Comments
cc @nsrip-dd |
Thanks for raising this, I hadn't considered that when sending the CL. Technically these are different stacks, as you observe, it's just that the choice of how much to skip makes them look the same. There is a similar issue with the heap profile, where map internals are elided from the end of call stacks and we can get multiple entries with the same stack in the pprof. A few things come to mind for how to address this:
|
I'll just braindump some more ideas:
|
The discussion in grafana/pyroscope-go#103 makes this look like a Go 1.23 regression to me. |
Change https://go.dev/cl/595966 mentions this issue: |
Any updates here? |
Yes, I've sent https://go-review.googlesource.com/c/go/+/595966 implementing my first suggested fix, to merge records with the same call stack before returning them from MutexProfile. The CL needs review, though it looks like it hasn't been automatically assigned reviewers as of this writing. |
Thanks @nsrip-dd ! I can review the CL. |
I gave it a non-maintainer pass; I'll leave it to @cherrymui . |
CL 595966 is reverted. Reopen. |
Change https://go.dev/cl/598515 mentions this issue: |
Go version
go1.23-f4494522dc
Output of
go env
in your module/workspace:What did you do?
I run this program on gotip https://go.dev/play/p/YD8N3UVACna?v=gotip and I get different results on
gotip
and1.22
I think the reason is before the change this line of code
go/src/runtime/mprof.go
Line 776 in 22344e1
used stack from
callers
/gcallers
which does skip logical frames and performs inline unwinding and looks like thisAnd after the change the same line uses stack from
fpTracebackPCs
which looks like this:
Because of that,
runtime.stkbucket
allocates twobucket
s for the same logical stack and therefore later we get twoBlockProfileRecord
with equal stack.I am not exactly sure this is a bug and how severe it is. It looks like it may lead to memory usage increase.
What did you see happen?
I see multiple
BlockProfileRecord
with equal stack.What did you expect to see?
If I run on 1.22 I get only one
BlockProfileRecord
The text was updated successfully, but these errors were encountered: