Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-[COEditingContext deletedPersistentRoots] doesn't return persistent roots marked deleted #20

Open
ericwa opened this issue Jun 19, 2015 · 0 comments

Comments

@ericwa
Copy link
Member

ericwa commented Jun 19, 2015

When you create a new COEditingContext and call -deletedPersistentRoots, it doesn't return those persistent roots marked deleted on disk. This is contrary to the docs for -deletedPersistentRoots which say:

/**
 * Returns persistent roots marked as deleted on disk, excluding those that
 * are pending undeletion, plus those pending deletion.
 */
@property (nonatomic, readonly) NSSet *deletedPersistentRoots;

The problem is -initWithStore:modelDescriptionRepository: calls [_store persistentRootUUIDs], which only returns non-deleted UUIDs.

This is the cause of the test failure in TestCrossPersistentRootReferences.m, -testLibraryPersistentRootUndeletion, the // FIXME: Currently fails for the isNewContext==NO case comment.

qmathe added a commit that referenced this issue Apr 26, 2016
…istent root relationships

I observed the issue with CoreObject version tagged as placeboard-1.0, I haven't figured out yet how to reproduce the issue in a test, but it seems the issue could still happen with the latest CoreObject master.

For the record, here is the crash stack trace with placeboard-1.0 tag and the corresponding EtoileFoundation commit:

#0	0x20cdadd8 in objc_exception_throw ()
#1	0x2142b8f0 in -[__NSSetM addObject:] ()
#2	0x0072f9a0 in -[CORelationshipCache referringObjects] at /Users/qmathe/reps/Etoile/Frameworks/CoreObject/Core/CORelationshipCache.m:122
#3	0x006a2310 in -[COObjectGraphContext replaceObject:withObject:] at /Users/qmathe/reps/Etoile/Frameworks/CoreObject/Core/COObjectGraphContext.m:883
#4	0x006c5ab8 in -[COObject willDiscard] at /Users/qmathe/reps/Etoile/Frameworks/CoreObject/Core/COObject.m:1726
#5	0x006a0ccc in -[COObjectGraphContext discardObjectsWithUUIDs:] at /Users/qmathe/reps/Etoile/Frameworks/CoreObject/Core/COObjectGraphContext.m:697
#6	0x0069bd34 in -[COObjectGraphContext dealloc] at /Users/qmathe/reps/Etoile/Frameworks/CoreObject/Core/COObjectGraphContext.m:121
#7	0x20cf4f8a in objc_object::sidetable_release(bool) ()
#8	0x0066e470 in -[COPersistentRoot .cxx_destruct] at /Users/qmathe/reps/Etoile/Frameworks/CoreObject/Core/COPersistentRoot.m:33
#9	0x20cd9f3c in object_cxxDestructFromClass(objc_object*, objc_class*) ()
#10	0x20ce3e4a in objc_destructInstance ()
#11	0x20ce3e6e in object_dispose ()
#12	0x20cf4f8a in objc_object::sidetable_release(bool) ()
#13	0x2142a788 in -[__NSDictionaryM dealloc] ()
#14	0x20cf4f8a in objc_object::sidetable_release(bool) ()
#15	0x006826b6 in -[COEditingContext .cxx_destruct] at /Users/qmathe/reps/Etoile/Frameworks/CoreObject/Core/COEditingContext.m:32
#16	0x20cd9f3c in object_cxxDestructFromClass(objc_object*, objc_class*) ()
#17	0x20ce3e4a in objc_destructInstance ()
#18	0x20ce3e6e in object_dispose ()
#19	0x0067b13e in -[COEditingContext dealloc] at /Users/qmathe/reps/Etoile/Frameworks/CoreObject/Core/COEditingContext.m:115
#20	0x20cf4f8a in objc_object::sidetable_release(bool) ()
#21	0x00725016 in -[COUndoTrack .cxx_destruct] at /Users/qmathe/reps/Etoile/Frameworks/CoreObject/Undo/COUndoTrack.m:34
#22	0x20cd9f3c in object_cxxDestructFromClass(objc_object*, objc_class*) ()
#23	0x20ce3e4a in objc_destructInstance ()
#24	0x20ce3e6e in object_dispose ()
#25	0x0071cc20 in -[COUndoTrack dealloc] at /Users/qmathe/reps/Etoile/Frameworks/CoreObject/Undo/COUndoTrack.m:83
#26	0x20cf4f8a in objc_object::sidetable_release(bool) ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants