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

fix(ios): guard against nil proxy in TiViewController #11753

Merged
merged 7 commits into from Jul 6, 2020

Conversation

sgtcoolguy
Copy link
Contributor

@sgtcoolguy sgtcoolguy commented Jun 4, 2020

JIRA: https://jira.appcelerator.org/browse/TIMOB-27930

Description:
We're seeing crashes on the test suite in CI. Mainly on iPad runs, but also occasionally iPhone. The crash logs seem to indicate that TiViewController's underlying _proxy field is nil. This PR simply guards for that case on all the delegate methods that access _proxy (and effectively try to forward delegate method calls).

Note that this should avoid the crash but there may be a deeper root cause that should be fixed as well. My best guess at this point is some odd edge case scenario with Ti.UI.iOS.NavigationWindow.

CI builds are running into hard crashes, typically on iPad but also
on iPhone. Crash logs indicate underlying null pointer for _proxy.

Fixes TIMOB-27930
@build build added this to the 9.1.0 milestone Jun 4, 2020
@build build requested a review from a team June 4, 2020 14:03
@build
Copy link
Contributor

build commented Jun 4, 2020

Messages
📖

💾 Here's the generated SDK zipfile.

📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.
📖

✅ All tests are passing
Nice one! All 6696 tests are passing.
(There are 703 skipped tests not included in that total)

Generated by 🚫 dangerJS against bf7fb65

Copy link
Contributor

@vijaysingh-axway vijaysingh-axway left a comment

Choose a reason for hiding this comment

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

I don't think this will have any effect on crash. Message passing on nil object is valid in Objective C.
e.g
id _proxy = nil;
BOOL isTrue = [_proxy conformsToProtocol:@protocol(TiWindowProtocol)]; will not crash and return 'false'.

@sgtcoolguy
Copy link
Contributor Author

I don't think the issue is that the _proxy is nil, it's that it's a reference to a deallocated proxy instance (i.e. a "zombie"). So I assume the nil check will guard against actually trying to call the conformsToProtocol message and avoid the crash. But the bigger issue is that we have a "zombie" pointer to a deallocated proxy instance still hung onto by the TiViewController

@ssjsamir ssjsamir self-requested a review July 2, 2020 11:52
Copy link
Contributor

@ssjsamir ssjsamir left a comment

Choose a reason for hiding this comment

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

FR Passed, Unit test suite no longer crashes on iPad tests.

@sgtcoolguy sgtcoolguy merged commit c2e5fb5 into tidev:master Jul 6, 2020
@sgtcoolguy sgtcoolguy deleted the TIMOB-27930 branch July 6, 2020 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants