generated from EmbarkStudios/opensource-template
-
Notifications
You must be signed in to change notification settings - Fork 11
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
First pass implementation #1
Merged
Merged
Conversation
This file contains 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
This function is only intended to be called in a compromised context, which means it should not be doing heap allocations
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.
Urgh, sorry I confused my tabs. Ignore this comment.
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.
This is a first pass implementation of the core components in this repository. This pass only addresses
x86_64-linux
targets at the moment since that was easiest to test.exception-handler
- Heavily based off of breakpad's linux signal handler, this wraps up all of the gnarly signal handling code and calls a user provided callback with the signal detailscrash-context
- Shared crate that defines the context of a crash on a per-target basis, so that different crates can be orchestrated (eg exception-handler creates it, minidumper passes it over IPC, minidump-writer uses it to write minidump information)ucontext_t
as part of the signal info to relay state about place and state of the thread where a signal was raised. Unfortunately this was deprecated in POSIX...but there is no replacement AFAIK. This is a problem since libc doesn't support ucontext_t fully for musl, because it's deprecated, but when using the ucontext_t to get information for crash dumps, several fields need to be accessed that aren't present in the libc version, so instead of try and get this working (and stay working) I just made our own small version based off of libunwind, as the structure is really just arch specific, and we need to be able to pass it from an initial signal handler all the way to a crash dumperminidumper
- This implements a simple IPC client/server where the client is meant to be run in a process that wants to monitor for crashes, and the server, which is responsible for handling minidump requests from the client and creating a minidump similar to how breakpad works. The linux implementation for the crash dump creation was already implemented in https://github.com/msirringhaus/minidump_writer_linux, thus just uses a fork that changes it to use the crash context from the exception handler so that we don't have any messy unsafe or bit twiddling shenanigansThere are also 2 crates purely for exercising these other implementation crates. I'm rather proud of the naming for
sadness-generator
.