-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime/pprof: goroutine profile at debug=2 hides the start of the finalizer goroutine #73011
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
Thanks, I agree this is misleading and I think it should be fixed. Both pprof and debug=1 profiles get the stacks from debug=2 profiles use The But that is an aside. While that would fix the immediate problem, I think this problem affects normal panics as well and should be fixed there as well. I think what we want to do avoid hiding a runtime frame if it is the first frame in the goroutine, as that can make the apparent first frame change across different traces of the same goroutine, which shouldn't be possible and is confusing. cc @golang/runtime @rhysh |
Indeed.
|
Change https://go.dev/cl/660295 mentions this issue: |
Change https://go.dev/cl/660296 mentions this issue: |
I don't follow how the apparent first frame would change, can you say more about that? |
By "first frame", I meant outermost frame (which is not the terminology the traceback code itself uses, apologies). So you may take a traceback and see
Then later take another traceback and see
The fact that |
Users see this frame in tracebacks and it serves as a hint that what is running here is a finalizer or cleanup. But runfinq is a rather dense name. We can give it a more obvious name to help users realize what it is. For #73011. Change-Id: I6a6a636ce9a493fd00d4b4c60c23f2b1c96d3568 Reviewed-on: https://go-review.googlesource.com/c/go/+/660296 Auto-Submit: Michael Pratt <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Michael Knyszek <[email protected]>
I see, that's an argument in support of showing |
Go version
1.23
Output of
go env
in your module/workspace:What did you do?
Following this discussion I run a program with a blocking finalizer and compared the output of the goroutine profile (debug=1, debug=2).
What did you see happen?
debug=1
debug=2
What did you expect to see?
We anticipated that the debug=2 goroutine trace would include the runtime.runfinq function, showing the path to the finalizer's routine, just as it does in debug=1. The absence of this trace in debug=2 during our blocked finalizer debugging made identifying the root cause significantly more challenging as we found no occurrences of mfinal.go in the trace.
The text was updated successfully, but these errors were encountered: