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-8863] Fix crash when reporting internal errors during +[Bugsnag start] #1474

Merged
merged 1 commit into from
Sep 1, 2022

Conversation

nickdowell
Copy link
Contributor

@nickdowell nickdowell commented Sep 1, 2022

Goal

Fix a crash that could occur when reporting internal errors during +[Bugsnag start].

Regression introduced in #1435 / v6.21.0

Changeset

Initializes BSGInternalErrorReporter AFTER bsg_runContext to ensure the latter is non-null.

Considered moving BSGRunContextInit to a +initialize method instead, but that would hinder testing - it would not be possible to set bsg_runContext to NULL and have it re-initialized when starting a new BugsnagClient.

Testing

Adds a unit test case that reproduced the problem and verifies the fix.

@github-actions
Copy link

github-actions bot commented Sep 1, 2022

Bugsnag.framework binary size did not change - 758,080 bytes

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%      +4  +0.0%      +4    __TEXT,__text
  -0.0%      -4  -0.0%      -4    [__TEXT]
  [ = ]       0  [ = ]       0    TOTAL

Generated by 🚫 Danger

@nickdowell nickdowell requested a review from kstenerud September 1, 2022 09:49
@nickdowell nickdowell enabled auto-merge (squash) September 1, 2022 09:56
if (self.configuration.telemetry & BSGTelemetryInternalErrors) {
BSGInternalErrorReporter.sharedInstance = [[BSGInternalErrorReporter alloc] initWithDataSource:self];
} else {
bsg_log_debug(@"Internal error reporting was disable in config");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor (pre-existing) typo, probably not worth a CI re-run unless you have other changes:

Suggested change
bsg_log_debug(@"Internal error reporting was disable in config");
bsg_log_debug(@"Internal error reporting was disabled in config");

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix in the release 👍

@nickdowell nickdowell merged commit 4262efb into next Sep 1, 2022
@nickdowell nickdowell deleted the nickdowell/fix-internal-error-startup-crash branch September 1, 2022 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants