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

NSObjectInaccessibleException: CoreData could not fulfill a fault #618

Closed
nbransby opened this issue Mar 23, 2012 · 5 comments
Closed

NSObjectInaccessibleException: CoreData could not fulfill a fault #618

nbransby opened this issue Mar 23, 2012 · 5 comments
Milestone

Comments

@nbransby
Copy link

I get this exception randomly but rarely and only once did I manage to
catch it in the debugger. It happens sometimes on the call to
[RKObjectManager postObject:delegate:].

Anyone have any ideas about this? Here are some details:

  • The object being posted is not deleted anywhere in my code during
    this operation
  • I have observed in the debugger that the sourceObject and
    targetObject ivars for the RKObjectMappingOperation are pointing at
    different NSManagedObject instances at the time of the crash, both of
    which have the same unique id in the store but the targetObject has
    been faulted.
  • I am using ARC

The stacktrace:

0 CoreFoundation 0x37fe18bf __exceptionPreprocess + 163
1 libobjc.A.dylib 0x31ac71e5 objc_exception_throw + 33
2 CoreData 0x3467722f _PFFaultHandlerLookupRow + 1107
3 CoreData 0x34676a97 _PF_FulfillDeferredFault + 187
4 CoreData 0x3467694f _sharedIMPL_pvfk_core + 39
5 CoreData 0x34676911 -
[NSManagedObject(_PFDynamicAccessorsAndPropertySupport)
_genericValueForKey:withIndex:flags:] + 49
6 CoreData 0x3467687d _PF_Handler_Public_GetProperty + 37
7 CoreData 0x346746b3 -[NSManagedObject valueForKey:] + 83
8 Foundation 0x31e79ddb -[NSObject(NSKeyValueCoding) valueForKeyPath:]
+ 131
9 MyApp 0x001310f1 -[RKObjectMappingOperation
shouldSetValue:atKeyPath:] (RKObjectMappingOperation.m:227)
10 MyApp 0x001316f5 -[RKObjectMappingOperation
applyAttributeMapping:withValue:] (RKObjectMappingOperation.m:299)
11 MyApp 0x00131baf -[RKObjectMappingOperation applyAttributeMappings]
(RKObjectMappingOperation.m:333)
12 MyApp 0x00133b7f -[RKObjectMappingOperation performMapping:]
(RKObjectMappingOperation.m:539)
13 MyApp 0x00115a03 -[RKManagedObjectMappingOperation performMapping:]
(RKManagedObjectMappingOperation.m:91)
14 MyApp 0x0012d90b -[RKObjectMapper
mapFromObject:toObject:atKeyPath:usingMapping:] (RKObjectMapper.m:214)
15 MyApp 0x0012d0ef -[RKObjectMapper
mapObject:atKeyPath:usingMapping:] (RKObjectMapper.m:150)
16 MyApp 0x0012e30f -[RKObjectMapper performMapping] (RKObjectMapper.m:
299)
17 MyApp 0x0012a369 -[RKObjectLoader
mapResponseWithMappingProvider:toObject:error:] (RKObjectLoader.m:186)
18 MyApp 0x0012a78b -[RKObjectLoader performMapping:]
(RKObjectLoader.m:217)
19 MyApp 0x0012a7e9 -[RKObjectLoader performMappingOnBackgroundThread]
(RKObjectLoader.m:225)
20 Foundation 0x31e87a91 -[NSThread main] + 73
21 Foundation 0x31f1b5a1 __NSThread__main__ + 1049
22 libsystem_c.dylib 0x36409c1d _pthread_start + 321
@alessandroorru
Copy link

I think it's s duplicate of the issue I posted here: #611

Check if when the crash occur restkit is trying to reference a core data entity that you just deleted in some way

@blakewatters
Copy link
Member

I have time carved out this weekend to drill into these issues and hopefully fix before shipping 0.9.4. Will update on these tickets after I drill in.

@blakewatters
Copy link
Member

@nbransby can you try the bits from the release/0.10.0 branch to see if the changes to fix #611 cover your issue as well? If not I can fix tomorrow -- I now have a much better understanding of what causes these crashes but don't have a good test case for your particular situation.

@nbransby
Copy link
Author

will do although I still can't easily reproduce the bug so it might take a while for me to confirm

blakewatters added a commit that referenced this issue Apr 4, 2012
… cache strategy

classes to eliminate issues with duplicated objects. closes #611, #612, #613, #618

* NSEntityDescription is now aware of the primaryKeyAttribute. Can be configured via
Interface Builder within Xcode or programatically.
* Added findByPrimaryKey: interface to the Core Data extensions.
* Relaxed dependencies on RKManagedObjectMapping across the system now that primaryKey is
available without a reference to the mapping.
@blakewatters
Copy link
Member

@nbransby a sanity check that the latest code covers your issue would be helpful if you have a minute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants