-
Notifications
You must be signed in to change notification settings - Fork 129
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
[PLAT-2016] Fix Swift fatal error message reporting #948
Conversation
Swift error messages are now extracted from crash_info_message
We were using this to capture Swift fatal error messages but now have a more reliable mechanism.
This is so awesome! Thanks for your work on this @nickdowell. Since this covers force unwrapping optionals, do you expect this to also capture the |
@sethfri I am not sure about the errors thrown from a |
@sethfri quick update: a description of the |
Bugsnag.framework binary size
Generated by 🚫 Danger |
Goal
Improve the reliability of capturing Swift fatal error messages passed to the following functions:
assertionFailure()
fatalError()
preconditionFailure()
It also covers implicit messages emitted by the Swift standard library, e.g.
Unexpectedly found nil while unwrapping an Optional value
As a bonus, the same mechanism also captures error messages from other libraries such as libdispatch, e.g.
BUG IN CLIENT OF LIBDISPATCH: dispatch_sync called on queue already owned by current thread
Design
The implementation examines the binary image of the crashing thread's top stack frame for a message in its
__crash_info
section, and parses this to extract the error type and message.The full, raw value of the
__crash_info
message is also made available in the event metadata, which may be useful when diagnosing certain types of crash.Changeset
__crash_info
message and store it in the KSCrashReport.BugsnagError
andBugsnagEvent
to read the message stored in the KSCrashReport, parse it, and update the error & event payload.RegisterErrorData
)Testing