Further information: I have just gone through every place in our code where it 
makes reference to the managed object context (there's only 90 of them thank 
goodness), and there is nothing there where we either retain or release a 
managed object context, or use one in a notification or anything like that.

I have also found out that the managed object context that is over-released is 
not the one that I have in my persistent document, so all I can assume is that 
it is one that is created behind the scenes programmatically during the 
persistent store migration.

I also checked our will/didTurnIntoFault and awakeFromInsert/Fetch to make sure 
they were clean. Found a few minor problems, but it made no difference. I did 
find that awakeFromFetch was called during the process of migration, but didn't 
find out anything else of interest. I also checked for description methods that 
may have caused faults to fire at the wrong time. I only found one description 
on one of our managed object classes, and an interesting thing happened when I 
commented that out - I could not save at all (trying to send an objectID 
message to an NSNumber). I have not tracked that one down yet.

I still feel as though I'm flying blind, so any suggestions from here would be 
welcome (I have also logged a DTS request on this but have not had any reply 
from them).

Time for some sleep (almost 5am), but if there are any suggestions as to where 
to look I'll pick them up when I wake up, and try them out.

Regards

Gideon



On 12/03/2010, at 6:50 PM, Gideon King wrote:

> Having sorted out the problem that occurred when I closed files, I am now 
> back to the "save as" issue (I was hoping that the two problems were related, 
> but apparently not). I have reverted to using a stock standard 
> NSManagedObjectContext I still haven't a clue where to look to debug this. 
> Running it normally gives the following error:
> 
> NovaMind5TP(3129,0x7fff70ee2be0) malloc: *** error for object 0x1149bdd30: 
> pointer being freed was not allocated
> 
> (gdb) po 0x1149bdd30
> <NSManagedObjectContext: 0x1149bdd30>
> 
> (gdb) bt
> #0  0x00007fff87290951 in malloc_error_break ()
> #1  0x00007fff871ba143 in free ()
> #2  0x00007fff8439471b in _internal_object_dispose ()
> #3  0x00007fff80e2d79a in -[NSObject(NSObject) dealloc] ()
> #4  0x00007fff874e4ff1 in -[NSManagedObjectContext dealloc] ()
> #5  0x00007fff874d40a3 in -[NSManagedObjectContext release] ()
> #6  0x00007fff80e0e246 in _CFAutoreleasePoolPop ()
> #7  0x00007fff8571a2f8 in -[NSAutoreleasePool drain] ()
> #8  0x00007fff87528eb9 in -[NSPersistentStoreCoordinator 
> migratePersistentStore:toURL:options:withType:error:] ()
> #9  0x00007fff8654e7e2 in -[NSPersistentDocument 
> writeToURL:ofType:forSaveOperation:originalContentsURL:error:] ()
> 
...._______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to