EXC_BAD_ACCESS when migrating an SQLite Core Data store in 10.6.x

Originator:iKenndac
Number:rdar://7347652 Date Originated:29th October 2009
Status:Open Resolved:
Product:Mac OS X Product Version:10.6.1
Classification:Crash/Hang/Data Loss Reproducible:Always
 
Summary:   

When migrating an SQLite data store, the application hangs in -[NSMigrationManager migrateStoreFromURL:type:options:withMappingModel:toDestinationURL:destinationType:destinationOptions:error:] with EXC_BAD_ACCESS.

  Steps to Reproduce:  

1. Open the included sample project in Xcode on Mac OS X 10.6.x and run it. Observe the results. 
2. Open the included sample project in Xcode on Mac OS X 10.5.8 and run it. Observe the results. 
3. There's no step three! 

 Expected Results: 

The migration to succeed (or fail gracefully).  

Actual Results:  On all versions of Mac OS X 10.6, the application hangs with EXC_BAD_ACCESS when migrating the store.   

Regression:  

This operation (and the included sample project) works as expected in Mac OS X 10.5.8.  

Sample project available here: http://dl.getdropbox.com/u/1399296/CoreDataCrashTest.zip

Comments

Workaround

The workaround in my case was to make sure I'm passing a valid error object to -migrateStoreFromURL:type:options:withMappingModel:toDestinationURL:destinationType:destinationOptions:error:. I was passing a nil error and something in Core Data was crashing when trying to dereference it. The appropriate information was added to my Radar report.

Same probleme here!

The exact same problem/crash occurs in my project under 10.6 I did not test it under 10.5 yet if it works.

http://twitter.com/iKenndac/status/5283725252

Could you please share the solution?


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!