Mac OS X 10.11.4: Model I/O: exportAssetToURL returns true, even when it fails.

Originator:iosdeveloperzone
Number:rdar://26530184 Date Originated:27-May-2016 08:36 PM
Status:Open Resolved:
Product:OS X Product Version:Mac OS X 10.11.4 (15E65)
Classification:Crash/Hang/Data Loss Reproducible:Always
 
Summary:
The MDLAsset method

public func exportAssetToURL(URL: NSURL) -> Bool

will return true even if it fails to produce an output file. Similarly the method will not throw when it fails to produce a file

public func exportAssetToURL(URL: NSURL, error: ()) throws

This bugs could lead to user data loss.
    
Steps to Reproduce:
1) Run the attached playground
2) Observe that when the export URL is to an existing directory the export succeeds as expected. When an attempt is made to export to a non-existent directory the method still returns true, but no output is produced. The playground tests for this condition and calls fatalError()

Expected Results:
If the export fails, the non-throwing method should return false and  the throwing method should throw an error. 

Actual Results:
The method returns true (or does not throw) even when it fails to produce output.

Regression:
The problem occurs on OS X 10.11.4 and also on iOS 9.3.

Comments

Attachment available on GitHub

https://github.com/iosdevzone/Radars/tree/master/26530184-ModelIOExportRadar

By iosdeveloperzone at May 28, 2016, 7 a.m. (reply...)

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!