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

Support logging stack traces on Windows during program crash. #535

Open
bmahler opened this issue Mar 13, 2020 · 0 comments
Open

Support logging stack traces on Windows during program crash. #535

bmahler opened this issue Mar 13, 2020 · 0 comments

Comments

@bmahler
Copy link

bmahler commented Mar 13, 2020

Currently it's not possible to use glog to dump stack traces (via InstallFailureSignalHandler()) on program crashes on windows because windows handles these without using signals. On windows, structured exception handling is used for these types of errors and one can set up an unexpected exception handler via SetUnhandledExceptionFilter(...):

https://docs.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-setunhandledexceptionfilter

Note that the stack is already unwound when this filter is called, therefore one has to use the information in the exception context record to walk the stack that triggered the exception. InstallFailureSignalHandler() could take on this responsibility, or another function could be provided that a user has to call for windows.

Note that the alternative of just exposing the stack trace dumping code (see issue 144) and having users call that from their own filter is not enough to solve this issue, since the stack is already unwound and it needs to be read from the exception info.

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

No branches or pull requests

2 participants