On Demand Resources: could not connect to its helper daemon.

Originator:neria
Number:rdar://34389684 Date Originated:12.9.17
Status:Open Resolved:No
Product:iOS Product Version:10.3.2
Classification:On Demand Resources Reproducible:No
 
Area:
Foundation

Summary:
After calling conditionallyBeginAccessingResourcesWithCompletionHandler for some users, the app crashes with the exception:

"Fatal Exception: NSInternalInconsistencyException
NSBundleResourceRequest could not connect to its helper daemon".

0   CoreFoundation                 0x1916befe0 __exceptionPreprocess
1   libobjc.A.dylib                0x190120538 objc_exception_throw
2   Foundation                     0x192207364 _setupConnection
3   libdispatch.dylib              0x1905769a0 _dispatch_client_callout
4   libdispatch.dylib              0x1905776cc dispatch_once_f
5   Foundation                     0x192206c84 +[NSBundleResourceRequest _connection]
6   Foundation                     0x192205b60 -[_NSBundleODRDataForApplications initWithBundle:]
7   Foundation                     0x192205a34 +[_NSBundleODRDataForApplications dataForBundle:createIfRequired:]
8   Foundation                     0x19220843c -[NSBundleResourceRequest conditionallyBeginAccessingResourcesWithCompletionHandler:]

Steps to Reproduce:
Unfortunately, we are unable to reproduce this issue on our devices. We see this crash for only small percentage of our users in production and the log above is what we have from Crashlytics, and it's the same stack-trace for all the users experienced this crash.

Expected Results:
Retrying connect to the daemon / returning an error instead of an exception.

Actual Results:
An exception is thrown and the app crashes.
"Fatal Exception: NSInternalInconsistencyException
NSBundleResourceRequest could not connect to its helper daemon".

Version/Build:
iOS 10.x - 11.x

Configuration:
There is just a single call for conditionallyBeginAccessingResourcesWithCompletionHandler before the crash on the main thread.

See other posts about this issue:
https://forums.developer.apple.com/thread/52518

https://stackoverflow.com/questions/44943083/on-demand-resources-crash-nsbundle-resource-request-could-not-connect-to-its-h

Comments

Did not found solution, sent another feedback to Apple

https://openradar.appspot.com/radar?id=4932391130890240

By stone33.mail at June 15, 2020, 9:59 a.m. (reply...)

Same things

Also this exception cant be handled with @try{}@catch

Mentioned here:

https://stackoverflow.com/questions/47474127/catching-exceptions-generated-within-dispatch-once-blocks


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!