Skip to content

Conversation

@denny-msft
Copy link

Started investigating the crash from #1370 and realized that ODWReachability should only be applicable for platforms below iOS 11 and macOS 10.14. However, a crash stack from an iOS 18 device clearly shows these classes being deallocated.

-[ODWReachability stopNotifier] ODWReachability.m:367
-[ODWReachability dealloc] ODWReachability.m:265
Microsoft::Applications::Events::PlatformAbstraction::NetworkInformation::~NetworkInformation() NetworkInformationImpl.mm:102

Seems like there was a bug where these reachability classes were being initialized without guarded availability checks (see NetworkInformation::SetupNetDetect:108) when they should only be used for lower platforms.

Regardless, given the EOL of these versions, this PR remove references to ODWReachability and fixes the crash.

Testing

Verified with build-ios.sh.

@denny-msft denny-msft requested a review from a team as a code owner August 13, 2025 00:55
@denny-msft denny-msft added bug Something isn't working iOS iOS related issue labels Aug 13, 2025
@lalitb
Copy link
Contributor

lalitb commented Aug 22, 2025

@absaroj - Can you help with the review. thanks.


m_reach = [ODWReachability reachabilityForInternetConnection];
void (^block)(NSNotification*) = ^(NSNotification*)
m_monitor = nw_path_monitor_create();
Copy link
Contributor

Choose a reason for hiding this comment

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

We should handle scenario where nw_path_monitor_create fails, and return nil - may be rare scenario but under system resource exhaustion?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is existing code, so probably not blocker here.

Copy link
Contributor

Choose a reason for hiding this comment

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

The API docs describe this return value as non-optional so it should never be nil - https://developer.apple.com/documentation/network/nw_path_monitor_create()

Copy link
Contributor

Choose a reason for hiding this comment

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

I take that back, I checked the docs in Xcode and it does indeed look like this can be nil. I'm finding a hard time finding a reference to these docs online. Here's what it says:

/*!
 * @function nw_path_monitor_create
 *
 * @abstract
 *		Create a default path monitor, that will allow the enumeration of all available
 *		interfaces on the system.
 *
 * @result
 *		Returns an allocated nw_path_monitor_t object on success.
 *		Callers are responsible for deallocating using nw_release(obj) or [obj release].
 *		These objects support ARC.
 *		Returns NULL on failure. Fails due to invalid parameters.
 */
API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0))
NW_RETURNS_RETAINED nw_path_monitor_t
nw_path_monitor_create(void);

@lalitb
Copy link
Contributor

lalitb commented Jan 5, 2026

One question: This change raises the minimum iOS version from 10.0 to 12.0. Are there any concerns about existing customer devices still running iOS 10/11, or is this acceptable given that Apple has long since ended support for these versions?

@thomasameisel
Copy link
Contributor

One question: This change raises the minimum iOS version from 10.0 to 12.0. Are there any concerns about existing customer devices still running iOS 10/11, or is this acceptable given that Apple has long since ended support for these versions?

I can only speak for iOS Outlook, but our min version is 18.0.

@denny-msft
Copy link
Author

One question: This change raises the minimum iOS version from 10.0 to 12.0. Are there any concerns about existing customer devices still running iOS 10/11, or is this acceptable given that Apple has long since ended support for these versions?

App Store apps are required to be built with Xcode 16 or later as of April 2025, and only supports iOS 15 or later, so we should be okay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working iOS iOS related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants