Invalid "resumeData" for download tasks on iOS 12

Number:rdar://46520274 Date Originated:12/6/2018
Status:Open Resolved:
Product:iOS + SDK Product Version:12.1
Classification:Other bug Reproducible:Always

In a download task to a server that doesn't support download resuming, using a background URLSession, the resume data produced for a cancelled task is invalid.

Steps to Reproduce:

 - Create a background session;
 - Start a download task to a server that doesn't support data resuming;
 - Cancel the download using "cancelByProducingResumeData:" before the download finishes;

Expected Results:

The resume data should be "nil".

Actual Results:

The resume data is not "nil", but it's invalid, doesn't allowing to start a new download with the resume data generated.

Additional info:

The same problem was tested using iOS SDK 10.3 and 11.4. The resume data for both version are "nil".


Xcode 10.1 (10B61)
iOS SDK 12.1 (16B91)


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at 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!