NSManagedObjectModel initWithContentsOfURL: opens Core Data model file in read-write mode

Originator:jbrayton
Number:rdar://18810980 Date Originated:2014-10-29
Status:Open Resolved:
Product:OS X Product Version:10.10
Classification:Serious Bug Reproducible:N/A
 
Summary:
Calling [NSManagedObjectModel initWithContentsOfURL:] opens Core Data model (.mom) files in read-write mode.

I believe that this does not cause the app to write to the model file. That may make the issue seem insignificant, but it was a big deal for me. It caused the App Review team to reject my app on the grounds that it tries to write to that file, even though it does not.  It took 8 days and a technical support incident to learn why the App Review team believed that the app was trying to write to the Core Data model file.

Steps to Reproduce:
N/A

Expected Results:
N/A

Actual Results:
N/A

Version:
10.10

Notes:
This is dtrace output I got from Apple Developer Technical Support;

probe: syscall::open:return, execname: "CloudPull\0", pid: 54719, ppid: 53840

libsystem_kernel.dylib`__open+0xa
Foundation`-[NSData(NSData) initWithContentsOfMappedFile:]+0x5b
Foundation`+[NSKeyedUnarchiver unarchiveObjectWithFile:]+0x4d
CoreData`-[NSManagedObjectModel initWithContentsOfURL:]+0x1fa
CloudPull`-[CLPCalendarExportOperation getEventModel]+0xd4
CloudPull`-[CLPCalendarExportOperation getCalendarEventMoc:]+0x62e
CloudPull`-[CLPCalendarExportOperation main]+0x121
Foundation`-[__NSOperationInternal _start:]+0x277
Foundation`__NSOQSchedule_f+0x40
libdispatch.dylib`_dispatch_client_callout+0x8
libdispatch.dylib`_dispatch_async_redirect_invoke+0x9a
libdispatch.dylib`_dispatch_client_callout+0x8
libdispatch.dylib`_dispatch_root_queue_drain+0x146
libdispatch.dylib`_dispatch_worker_thread2+0x28
libsystem_pthread.dylib`_pthread_wqthread+0x13a
libsystem_pthread.dylib`start_wqthread+0xd

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!