Skip to content
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

WER dumps generate corrupted stacks #1357

Open
qmuntal opened this issue Oct 8, 2024 · 1 comment
Open

WER dumps generate corrupted stacks #1357

qmuntal opened this issue Oct 8, 2024 · 1 comment
Assignees

Comments

@qmuntal
Copy link
Member

qmuntal commented Oct 8, 2024

The Core OS team are trying to use WER dumps generated by setting GOTRACEBACK=wer. They can successfully generate dumps for crashing programs, but with what seems to be corrupted stack traces.

WER support for Go was upstreamed by us in Go 1.21 (see golang/go#57441). One of the limitations at that time is the lack of test coverage related to examining the dump content using a debugger, as this is out of the Go standard library test suite. This means that something might have been broken in the meantime. We tried to partially mitigate this lack of upstream testing by testing it ourselves in https://github.com/microsoft/go-pdb/blob/fa4e71cc7269ca83f021f07948e49b1f7af7eae1/gopdb/gopdb_windows_test.go#L209, but the test suite is not extensive.

Back to the issue, it can be reproduced by a simple hello world crashing app:

package main

func main() {
    panic("oh no!")
}

And then using Delve or WinDbg to examine the dump.

Reported by @kevpar and @mtbar131

@qmuntal qmuntal self-assigned this Oct 8, 2024
@qmuntal
Copy link
Member Author

qmuntal commented Oct 10, 2024

While investigating this issue I found that the exception address from the exception record was not correct in case of a panic. I've submitted an upstream CL to fix this: https://go-review.googlesource.com/c/go/+/619296, and it contains tests!

Note that it doesn't fix the corrupted stack trace, but at least WinDbg is able to show the faulting source code:

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant