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

Add a seg fault handler on Windows #579

Open
mkilgore opened this issue Nov 26, 2024 · 0 comments
Open

Add a seg fault handler on Windows #579

mkilgore opened this issue Nov 26, 2024 · 0 comments
Labels
enhancement New feature or request logging

Comments

@mkilgore
Copy link
Contributor

#566 adds a SIGSEGV handler for Linux and Mac OS that attempts to log an error before exiting. This is a pretty nice feature as it can allow you to get a stacktrace when a seg fault happens (or at least, attempt to get one, there's no guarantee things are in a state to successfully capture one). I have not tried adding a SIGSEGV handler on Windows but I don't think it works, it looks like SetUnhandledExceptionFilter is the way to do this on Windows.

A big catch here is that I'm not sure that SetUnhandledExceptionFilter is called from the thread that triggered the seg fault. If not then it might get messy as I'm not sure _Unwind_Backtrace offers a way to do a stacktrace from a separate stack-pointer.

@mkilgore mkilgore added enhancement New feature or request logging labels Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request logging
Projects
None yet
Development

No branches or pull requests

1 participant