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

[PLAT-6346] Fix deadlock in bsg_recordException() #1082

Merged
merged 1 commit into from
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ void bsg_recordException(NSException *exception) {
bsg_lastHandledException = exception;
BSG_KSLOG_DEBUG(@"Writing exception info into a new report");

BSG_KSLOG_DEBUG(@"Suspending all threads.");
bsg_kscrashsentry_suspendThreads();

BSG_KSLOG_DEBUG(@"Filling out context.");
NSArray *addresses = [exception callStackReturnAddresses];
NSUInteger numFrames = [addresses count];
Expand All @@ -137,6 +134,9 @@ void bsg_recordException(NSException *exception) {
bsg_g_context->stackTrace = callstack;
bsg_g_context->stackTraceLength = callstack ? (int)numFrames : 0;

BSG_KSLOG_DEBUG(@"Suspending all threads.");
bsg_kscrashsentry_suspendThreads();

BSG_KSLOG_DEBUG(@"Calling main crash handler.");
bsg_g_context->onCrash(crashContext());

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Changelog

### Bug fixes

* Fix a possible deadlock when writing crash reports for uncaught Objective-C exceptions.
[#1082](https://github.com/bugsnag/bugsnag-cocoa/pull/1082)

* Fix missing `context` for crash, OOM, and app hang errors.
[#1079](https://github.com/bugsnag/bugsnag-cocoa/pull/1079)

Expand Down