HTTP Status 403 does not report error or failed AVPlayerItem

Originator:jgary
Number:rdar://39248785 Date Originated:April 6 2018
Status:Open Resolved:
Product:iOS/AVFoundation Product Version:11.3
Classification:Crash?Hang/Data Loss Reproducible:Always
 
Area:
AVFoundation

Summary: On iOS 11, initializing an AVURLAsset with a URL that will respond with status 403 (I've only tried that status, I don't know about other 4xx status codes), the status on the AVPlayerItem does not change to failed. This is a regression, as in iOS 9 and iOS 10, the AVPlayerItem using that asset would enter the failed state and have a non-nil error (although one with an inscrutable error code). On the iOS 11 simulator, there appears to be a deadlock in the network stack. I've attached the backtrace for that case. On an iOS 11 device, I see the following in the console, but again the AVPlayerItem does not enter the failed state or report an error. The following error appears in the debug console:

2018-04-06 17:04:27.906833-0400 Play One Video[329:44494] CredStore - performQuery - Error copying matching creds.  Error=-25300, query={
    class = inet;
    "m_Limit" = "m_LimitAll";
    "r_Attributes" = 1;
    sync = syna;
}

Steps to Reproduce:
Run attached project. It has a URL that responds with 403.

Expected Results:
An error reflecting HTTP status, but I'd settle for the same error as iOS 9/10:
Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x14e94230 {Error Domain=NSOSStatusErrorDomain Code=403 "(null)"}, NSLocalizedFailureReason=An unknown error occurred (403)}

(on simulator it's different)
Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSUnderlyingError=0x7f9aecd8faf0 {Error Domain=NSOSStatusErrorDomain Code=-12643 "(null)"}, NSLocalizedFailureReason=An unknown error occurred (-12643), NSLocalizedDescription=The operation could not be completed}

Actual Results:
Player is dead to me. No way to detect.

Version/Build:
iOS 11.3 (15E216)


Configuration:
Model: iPhone 6s Plus
Version 10.0 (SimulatorApp-851.2 CoreSimulator-518.19)

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!