-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: WinDbg fails to unwind the Go stack #57404
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
WinDbg uses RtlVirtualUnwind to unwind the stack, and that function needs SEH unwinding information in the PE binary to correctly display the call stack. Go binaries do not currently contain this information. See #57302 for more context. |
I think you intend that this be your bug, feel free to turn that off if I was wrong. One thing to think about is how to automate testing for some of this; we've tried various things over the years and none of them was entirely satisfactory. The tests that attempted to mimic the experience of a user actually stepping through code were too flaky; probably the Delve API would have been a better approach. |
Yep.
Good point. Testing the WinDbg integration will be hard, even if using its interactive command line version, |
SEH stack unwinding has been implemented on windows/amd64, and I can confirm that WinDbg can correctly unwind the Go stack thanks to that. SEH support for windows/arm64 is still not there, the effort is tracked in #57302. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Debug a Go binary using WinDbg, break at the first instruction of
main()
and advance step by step.Synthetic sample:
What did you expect to see?
WinDbg is capable of unwind the stack at any PC.
What did you see instead?
The call stack contains is more or less in good shape at the first instruction of
main
prologue:Legend:
main()
runtime.main()
a()
The call stack contain garbage data after the first instruction that grows the stack pointer inside
main()
prologue.The call stack is lost after the first instruction that grows the stack pointer inside
a()
prologue:The text was updated successfully, but these errors were encountered: