-
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: stack traces do not indicate the caller for deferred calls #46757
Comments
The non- It is also missing the frame for the actual
|
For an illustration of why this matters, consider a user debugging a function that defers multiple calls to the same function (https://play.golang.org/p/Ws12WDC1KuI). Without the stack traces to thread the calls together, it can be much harder to figure out the actual sequence of calls that lead to the panic. |
Thinking about this some more...
Perhaps:
|
Another example in https://build.golang.org/log/1a19e22ad826bedeb5a939c6130f368f9979208a:
The top of that goroutine dump is the runtime's own call to The first frame in actual user code is here: But the code at that line does not match the |
The stack trace in https://build.golang.org/log/ee6465ff7dc022b6679688af37b7b40211d8521c seems to omit an important line number from the stack trace. It appears to be reporting a
panic
within a deferred function call.The start of the call to the deferred function occurs at line 1129:
go/src/testing/testing.go
Line 1129 in 8a5a6f4
The parentheses that actually invoke it are at line 1233:
go/src/testing/testing.go
Line 1233 in 8a5a6f4
However, neither of those lines is included in any of the frames in the stack trace:
The text was updated successfully, but these errors were encountered: