NSBundleResourceRequest::progress::cancel throws an exception
| Originator: | borissotillos | ||
| Number: | rdar://24150990 | Date Originated: | 12-Jan-2016 06:57 PM |
| Status: | closed | Resolved: | 28-Jan-2016 |
| Product: | tvOS SDK | Product Version: | apple TV 9.1 (13U85) |
| Classification: | Reproducible: | 100% |
Boris Sotillos 12-Jan-2016 06:57 PM Summary: NSBundleResourceRequest::progress::cancel is causing the framework's download thread to throw an exception, and apparently, it is not cleaning up properly, causing a deadlock that makes itself evident on the next recovery/request. I would expect that at least, if cancellation is not possible, the framework completes downloads but does not crash. Note that progress::isCancellable returns YES If we run the demo application with an Exception Breakpoint enabled for all exceptions, on throw (see cancel.png). We get the console output: 2016-01-12 18:08:54.214 crappy[1047:2673618] 1 2016-01-12 18:08:54.217 crappy[1047:2673618] 2 cancellable = 1 2016-01-12 18:08:54.228 crappy[1047:2673641] conditionallyBeginAccessingResourcesWithCompletionHandler downloadRequired = 1 2016-01-12 18:08:55.219 crappy[1047:2673618] 3 2016-01-12 18:08:55.219 crappy[1047:2673618] 4 downloadRequired = 1 2016-01-12 18:08:55.221 crappy[1047:2673618] 6 2016-01-12 18:09:01.228 crappy[1047:2673618] 7 cancel 2016-01-12 18:09:01.228 crappy[1047:2673641] cancellationHandler And then, an exception break, caused by an objc_exception_throw. If we run the app without enabling Exception breaks, we get the console output: 2016-01-12 18:09:46.666 crappy[1052:2673996] 1 2016-01-12 18:09:46.670 crappy[1052:2673996] 2 cancellable = 1 2016-01-12 18:09:46.680 crappy[1052:2674014] conditionallyBeginAccessingResourcesWithCompletionHandler downloadRequired = 1 2016-01-12 18:09:47.671 crappy[1052:2673996] 3 2016-01-12 18:09:47.672 crappy[1052:2673996] 4 downloadRequired = 1 2016-01-12 18:09:47.674 crappy[1052:2673996] 6 2016-01-12 18:09:53.679 crappy[1052:2673996] 7 cancel 2016-01-12 18:09:53.679 crappy[1052:2674015] cancellationHandler 2016-01-12 18:09:53.691 crappy[1052:2674013] <NSXPCConnection: 0x12fe2d0e0> connection to service named com.apple.ondemandd.client: Warning: Exception caught during decoding of received reply to message 'pinTags:inBundle:priority:completionHandler:', dropping incoming message and calling failure block. Exception: Unable to add the URL file:///var/mobile/Library/OnDemandResources/AssetPacks/com.gameloft.test-d/7671957809540947968/com.gameloft.test-d.asset-pack-00000008JP3H9.assetpack/ to the bundle NSBundle </var/mobile/Containers/Bundle/Application/0EA25FB2-1DA3-46B5-988C-94454E857F32/crappy.app> (loaded) 2016-01-12 18:09:53.692 crappy[1052:2674013] beginAccessingResourcesWithCompletionHandler 2016-01-12 18:09:54.681 crappy[1052:2673996] 8 2016-01-12 18:09:54.682 crappy[1052:2673996] 9 2016-01-12 18:09:54.694 crappy[1052:2674013] conditionallyBeginAccessingResourcesWithCompletionHandler downloadRequired = 1 2016-01-12 18:09:55.684 crappy[1052:2673996] 10 2016-01-12 18:09:55.684 crappy[1052:2673996] 11 downloadRequired = 1 2016-01-12 18:09:55.685 crappy[1052:2673996] 12 a2016-01-12 18:10:30.510 crappy[1052:2674013] *** -[NSLock lock]: deadlock (<NSLock: 0x12fe2cf30> '(null)') 2016-01-12 18:10:30.510 crappy[1052:2674013] *** Break on _NSLockError() to debug. which also exhibits the same behaviour. Steps to Reproduce: I'm attaching a tvOS xcode project run it, following instruction on the "description" Expected Results: cancellation of the resource request Actual Results: internally throws on cancel, that causes ulterior deadlock Version: apple TV 9.1 (13U85) Notes: Configuration: ATV using LAN Attachments: 'crappy_cancel.zip' was successfully uploaded. ======================================================================================================================================= Apple Developer Relations 14-Jan-2016 09:38 PM Do you still see this issue in the latest iOS 9.3 beta release? Please test with this release. If you still have issues, please update your bug report with any relevant logs or information that could help us investigate. iOS 9.3 https://developer.apple.com/ios/download/ ======================================================================================================================================= Apple Developer Relations 25-Jan-2016 10:42 PM Do you still see this issue in the latest iOS Beta? Please test with the latest Beta. If you still have issues, please update your bug report with any relevant logs or information that could help us investigate. iOS https://developer.apple.com/ios/download/ ======================================================================================================================================= Boris Sotillos 26-Jan-2016 09:49 AM Hi, I'll be trying to reproduce this. When I have the time. ======================================================================================================================================= Boris Sotillos 26-Jan-2016 11:26 AM BTW. The application is a tvOS application, not an iOS application. I'll be trying tvOS 9.2 beta 2 ======================================================================================================================================= Boris Sotillos 28-Jan-2016 04:32 PM Retested with tvOS 9.2 beta 2 (12Y5189e), compiled on Xcode 7.3 beta (7D129n) THE ISSUE HAS BEEN FIXED.
Comments
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!