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-5471] Fix crash in BugsnagClient.m line 818 #904

Merged
merged 1 commit into from
Nov 23, 2020

Conversation

nickdowell
Copy link
Contributor

Goal

Two types of crashes were seen in __42-[BugsnagClient setupConnectivityListener]_block_invoke (BugsnagClient.m:818:9):

NSInvalidArgumentException: -[NSOperationQueue addAutoBreadcrumbOfType:withMessage:andMetadata:]: unrecognized selector sent to instance 0x107e18e50

0  CoreFoundation          ___exceptionPreprocess
1  libobjc.A.dylib         _objc_exception_throw
2  CoreFoundation          -[NSObject(NSObject) doesNotRecognizeSelector:]
3  CoreFoundation          ____forwarding___
4  CoreFoundation          ___forwarding_prep_0___
5  App                     __42-[BugsnagClient setupConnectivityListener]_block_invoke (BugsnagClient.m:818:9)
6  App                     BSGConnectivityCallback (BSGConnectivity.m:97:9)
EXC_BAD_ACCESS: Attempted to dereference garbage pointer 0x646e616d6d6f63.

0  libobjc.A.dylib         _objc_msgSend
1  App                     __42-[BugsnagClient setupConnectivityListener]_block_invoke (BugsnagClient.m:818:9)
2  App                     BSGConnectivityCallback (BSGConnectivity.m:97:9)

Note: line numbers differ slightly because the reports were for v6.2.3

Both point to the fact that the self pointer inside the block was invalid, and strongSelf should have been used instead.

Copy link
Contributor

@kattrali kattrali left a comment

Choose a reason for hiding this comment

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

Nice one!

@nickdowell nickdowell merged commit 27d2f59 into next Nov 23, 2020
@nickdowell nickdowell deleted the nickdowell/fix-crash-in-connectivity-listener branch November 23, 2020 15:55
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.

2 participants