-
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
Capture trace of error reporting thread and identify with boolean flag #303
Conversation
Source/BugsnagCrashReport.m
Outdated
- (void)serialiseThread:(NSMutableArray *)bugsnagThreads | ||
thread:(NSDictionary *)thread | ||
backtrace:(NSArray *)backtrace | ||
crashedThread:(BOOL)isCrashedThread { |
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.
I would be careful to call this the reportingThread or the currentThread to emphasize that its not the crashing thread in all cases.
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.
This makes sense - I've updated the parameter name.
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.
Works as expected 👍
There should be a test for this behavior. There is currently one for the thread count, but should also be one to verify that one thread is marked as the reporting thread and that the ID matches the crash thread ID.
Labelling as WIP as the mazerunner scenario appears to have failed on Travis CI, and the build queue is currently blocked which means I'm unlikely to investigate this further by the end of today :( |
That’s fine, thanks. Provided it’s not reraised as needing review, it should be fine until you’re done with it. |
…handled exception
Added an additional mazerunner scenario that ensures only one thread is marked as the errorReportingThread from a handled exception.
|
Goal
Captures the trace of the crashed thread, which was previously omitted, and to identify it with a boolean flag in the serialised JSON.
Changeset
errorReportingThread
boolean flag by checkingcrashed
flagNote: the thread name is not captured due to known limitations with how KSCrash captures this information.
Tests
Added unit tests for general thread serialisation, and for checking that the current thread is now captured. Tested with dashboard.
Review
For the submitter, initial self-review:
For the pull request reviewer(s), this changeset has been reviewed for: