-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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/pprof: incorrect function names for generics functions #64528
Comments
Change https://go.dev/cl/546815 mentions this issue: |
Also this line could be affected in similar way, but Im not 100% sure yet. Line 564 in de5b418
|
Thanks for the report. Could you reproduce with a memory profile taken by the pprof package, instead of manually constructing the records? The code above creates records corresponding to generic functions that are usually wrappers and not shown in profiles. Using an actually profile makes the test more realistic. Thanks. |
@cherrymui Thanks. Yes I found this problem with real-world memory profile dump. I've updated the test in CL to dump the profile with pprof package. |
Thanks for the report and fix. I think this warrants a backport. @gopherbot Please backport to 1.21. This can create invalid profiles when using generics with no practical workaround. |
Backport issue(s) opened: #64609 (for 1.21). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
I haven't thought about this closely, but I suspect it would be affected. |
I think I reproduced it https://gist.github.com/korniltsev/f6c639c68c7c40e1ead5db6012abed92 |
Perhaps your IDE disables optimizations/inlining ( |
Change https://go.dev/cl/549535 mentions this issue: |
profileBuilder is using Frame->Function as key for checking if we already emitted a function. However for generics functions it has dots there [...], so sometimes for different functions with different generics types, the profileBuilder emits wrong functions. For #64528 For #64609 Change-Id: I8b39245e0b18f4288ce758c912c6748f87cba39a Reviewed-on: https://go-review.googlesource.com/c/go/+/546815 Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com> (cherry picked from commit 20a03fc) Reviewed-on: https://go-review.googlesource.com/c/go/+/549535 Auto-Submit: Matthew Dempsky <mdempsky@google.com>
profileBuilder is using Frame->Function as key for checking if we already emitted a function. However for generics functions it has dots there [...], so sometimes for different functions with different generics types, the profileBuilder emits wrong functions. Fixes golang#64528 Change-Id: I8b39245e0b18f4288ce758c912c6748f87cba39a Reviewed-on: https://go-review.googlesource.com/c/go/+/546815 Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com>
* fix(godeltaprof): port fix for golang/go#64528 * fix(godeltaprof): port fix for golang/go#64641 * add go 1.22 for testing
Go version
go version devel go1.22-de5b418bea Sat Dec 2 03:15:03 2023 +0000 linux/amd64
What operating system and processor architecture are you using (
go env
)?What did you do?
I wrote a test
What did you expect to see?
I expected the test to pass
What did you see instead?
The test fails.
I suspect the reason is because
profileBuilder
is usingFrame->Function
as key for checking if we already emited a function. However for generics functions it has dots there[...]
, so sometime for different functions with different generics types, theprofileBuilder
uses wrong functions.https://github.com/golang/go/blob/de5b418bea70aaf27de1f47e9b5813940d1e15a4/src/runtime/pprof/proto.go#L614C39-L614C39
The text was updated successfully, but these errors were encountered: