10.8 GM crashes opening SQLite DB in a multi-doc, sandboxed app w/space in name

Originator:kevin
Number:rdar://11860951 Date Originated:7/12/12
Status:Open Resolved:
Product:OS X Product Version:10.8 GM
Classification:Bug Reproducible:Yes
 
12-Jul-2012 04:17 PM Kevin Hamilton:
Summary:

A sandboxed, multi-document, Core Data application that has a space in the application's name (example: 'Crash Test') will crash under the GM build of OS X 10.8 when opening a SQLite-based document. This works fine under 10.7. The application also works fine under 10.8 when built without enabling the application sandbox.

Steps to Reproduce:

I encountered this problem testing a sandboxed version of a complex application but was able to reproduce the problem using the File Wrappers with Core Data Document example application from Apple (a packaged document file is required for sandboxing to work with SQLite-based documents outside of the app's container). I first modified the project to build under Xcode 4.4 and run in a sandboxed environment. The application ran fine and I was able to create, save, and load test documents. To reproduce this problem, run the app and add some data to a document and save it. This version is in the Source 1 directory of the attached CrashInfo.zip file.

Next, I changed the project name to Crash Test in the Identity section of the File Inspector. The application crashes when trying to load a document created by the version compiled from Source 1. This version is attached as Source 2 directory of the attached CrashInfo.zip file.

In the target build settings, change the Product Name from Crash Test to CrashTest, with no space between the two words, and rebuild. It should now be able to load the document you created with the Source 1 build.

Expected Results:

I would expect the code to run fine, even with a space in the app's filename. This has never been a problem in the past.

Actual Results:

The following messages are written to the log when an attempt is made to open a file with the Source 2 build:

2012-07-12 15:57:42.895 Crash Test[14481:303] Request for item CoreDataStore.sql-journal related to document /Users/kevin/Documents/Crash Test.wrapper/CoreDataStore.sql failed: Error Domain=NSOSStatusErrorDomain Code=-67068 "The operation couldn’t be completed. (OSStatus error -67068.)"
2012-07-12 15:57:42.897 Crash Test[14481:303] Request for item CoreDataStore.sql-shm related to document /Users/kevin/Documents/Crash Test.wrapper/CoreDataStore.sql failed: Error Domain=NSOSStatusErrorDomain Code=-67068 "The operation couldn’t be completed. (OSStatus error -67068.)"
2012-07-12 15:57:42.899 Crash Test[14481:303] Request for item CoreDataStore.sql-wal related to document /Users/kevin/Documents/Crash Test.wrapper/CoreDataStore.sql failed: Error Domain=NSOSStatusErrorDomain Code=-67068 "The operation couldn’t be completed. (OSStatus error -67068.)"
2012-07-12 15:57:42.900 Crash Test[14481:303] Request for item .CoreDataStore.sql-conch related to document /Users/kevin/Documents/Crash Test.wrapper/CoreDataStore.sql failed: Error Domain=NSOSStatusErrorDomain Code=-67068 "The operation couldn’t be completed. (OSStatus error -67068.)"

The application then crashes. The crash report is attached. The crash has the hallmarks of a double-free, so I ran the Source 2 build with Instruments and found exactly that on an NSError instance released in [NSPersistentDocument _requestRelatedItemForURL:withLastComponent:]. See the Zombie.png screenshot in CrashInfo.zip.

Regression:

This problem occurs under the GM build of OS X 10.8 but does not happen under OS X 10.7.4. The application runs fine under 10.8 if sandboxing is NOT enabled.

Notes:

This is an extremely critical problem for us and is preventing us from releasing an update of our application that supports the application sandbox.

12-Jul-2012 04:17 PM Kevin Hamilton:
'CrashInfo.zip' and 'Crash Test_2012-07-12-160138_K-Dogs-ML-Install.crash' were successfully uploaded

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!