-
Notifications
You must be signed in to change notification settings - Fork 584
Improve crashlog #8865
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
Merged
Merged
Improve crashlog #8865
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Blocked by |
0e874af
to
bf1c33c
Compare
julianbrost
requested changes
Jul 6, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase to remove commits not part of this PR so that GitHub doesn't show them as part of this PR.
bf1c33c
to
e4d34de
Compare
e4d34de
to
60b9afc
Compare
On Windows, the termination handler is executed for uncaught C++ exceptions unless a SEH unhandled exception filter is also set. In this case, this filter has to explicitly chain the default filter to keep this behavior.
This is more similar to the normal exception crashlog which also states the problem and time at the beginning of the file.
Provides roughly the same functionality but works better on certain platforms (especially Windows) and is less code to maintain.
By default, DiagnosticInformation uses the stack trace saved when the exception was thrown, but this mechanism is not in use on Windows. Gathering a stacktrace in the terminate handler serves as a fallback.
…n and document behavior The logic for selecting the traces to print stays the same, but there are fewer nested ifs now. This changes the format of the returned string a bit by adding a heading for both traces.
Maybe this will save the next person who has to look at this code some time. Please don't blame me for the implementation, I'm just trying to reconstruct what it does.
Older versions of MSVC fail to rethrow an unhandled C++ exception (using `throw;`) in the termination handler (`std::set_terminate`), however Icinga relies on this behavior in its crash handler (`Application::ExceptionHandler`).
This makes the format more similar to what the uncaught C++ and SEH exception handlers write. Previously there was no indication in the crash log that a SIGABRT happened.
Unfortunately, the symbol resolution of boost::stacktrace is broken on FreeBSD, therefore fall back to using backtrace_symbols() to print the stack trace saved by Boost. Additionally, -D_GNU_SOURCE is required on FreeBSD for the _Unwind_Backtrace function used by boost::stacktrace.
So far, the check that actually sets HAVE_LIBEXECINFO was executed after it was already used to add dependencies.
Needed by `boost::stacktrace` for `_Unwind_Backtrace()`.
- Explicitly disable optimizations for MSVC - Make stack_test_func_a bigger
60b9afc
to
7bfe896
Compare
|
Commit with additional test code: dd7eabe Linux C++ Exception
Linux SIGABRT
Windows x86-64 SEH
Windows x86-64 C++ Exception
Windows x86 SEH
Windows x86 C++ Exception
|
julianbrost
approved these changes
Jul 8, 2021
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of