-
Notifications
You must be signed in to change notification settings - Fork 162
Nil check our run loop thread #771
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
Conversation
Merge upstream into fork
|
| { | ||
| if (!_scheduledRunloops.count) { | ||
| [self scheduleInRunLoop:[NSRunLoop RCTSR_networkRunLoop] forMode:NSDefaultRunLoopMode]; | ||
| // [TODO(macOS ISS#2323203): `scheduleInRunLoop:forMode:` takes in a non-null run loop parameter so let's be safe and verify that |
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.
Do we have a better bug number or can we create one in git then this generic ISS number?
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 looked and one didn't exist. I figure since we need to go through and update all of these anyway, making it one that we can easily track/update all at once might be easier than making a new one and not tracking it well/forgetting about it
* Update RCTCxxBridge.mm * Update RCTCxxBridge.mm * run loop nil check Co-authored-by: Chris Hogan <chrishogan@Chriss-MacBook-Pro-2.local>
* Update RCTCxxBridge.mm * Update RCTCxxBridge.mm * run loop nil check Co-authored-by: Chris Hogan <chrishogan@Chriss-MacBook-Pro-2.local>
* Add nullability checks (#704) * Update RCTCxxBridge.mm * add nullability checks * Nil check our run loop thread (#771) * Update RCTCxxBridge.mm * Update RCTCxxBridge.mm * run loop nil check Co-authored-by: Chris Hogan <chrishogan@Chriss-MacBook-Pro-2.local> * podfile lock Co-authored-by: Chris Hogan <chrishogan@Chriss-MacBook-Pro-2.local>
Please select one of the following
Summary
Our logs show intermittent crashes with the stack ending here. It's not obvious what's failing as everything in the stack is pretty safe, but the only potentially suspicious behavior is we blindly pass in an NSRunLoop object into a non-null parameter of a method.
It's not obvious how the custom run loop could fail to instantiate, but there's no harm in being safe here and adding a nil check and log to see if we ever hit this.
After this gets in I can bring the same change over to our stable branches.
Changelog
[General] [Bug] - Nil check our custom run loop
Test Plan
It's just a simple nil check so nothing to test here. I can't repro the failure but in a test app was able to verify we'll throw an exception if we pass a nil object in as a non-null parameter.