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

Already on GitHub? Sign in to your account

EXC_BAD_ACCESS (code=1, address=0x50000008) on [[NSManagedObjectContext defaultContext] save*] #436

Closed
stianhoiland opened this Issue Mar 24, 2013 · 1 comment

Comments

Projects
None yet
1 participant

In iOS 5.0 & 5.1 Simulator (not 6.0 or 6.1) calling any of the save methods on defaultContext causes crash.

[MagicalRecord save*] does not.

Crash happens inside @try in id saveBlock declared in NSManagedObjectContext+MagicalSaves.m

thread #1: tid = 0x1c03, 0x0185509b libobjc.A.dylib`objc_msgSend + 15, stop reason = EXC_BAD_ACCESS (code=1, address=0xa0000008)
    frame #0: 0x0185509b libobjc.A.dylib`objc_msgSend + 15
    frame #1: 0x014786c7 Foundation`-[NSError dealloc] + 71
    frame #2: 0x01855e4d libobjc.A.dylib`_objc_rootRelease + 47
    frame #3: 0x01855e10 libobjc.A.dylib`objc_release + 48
    frame #4: 0x01856c60 libobjc.A.dylib`(anonymous namespace)::AutoreleasePoolPage::pop(void*) + 528
    frame #5: 0x01987ed8 CoreFoundation`_CFAutoreleasePoolPop + 24
    frame #6: 0x014200e4 Foundation`-[NSAutoreleasePool drain] + 155
    frame #7: 0x00360371 CoreData`-[NSManagedObjectContext save:] + 929
    frame #8: 0x00084cee MyApp`__70-[NSManagedObjectContext() MR_saveWithOptions:completion:]_block_invoke3 + 53 at NSManagedObjectContext+MagicalSaves.m:64
    frame #9: 0x00383af3 CoreData`developerSubmittedBlockToNSManagedObjectContextPerform + 99
    frame #10: 0x00383a1f CoreData`-[NSManagedObjectContext performBlockAndWait:] + 95
    frame #11: 0x00084c0b MyApp`-[NSManagedObjectContext(, _cmd=0x000b4abc, completion=0x00000000) MR_saveWithOptions:completion:] + 277 at NSManagedObjectContext+MagicalSaves.m:107
    frame #12: 0x00084af1 MyApp`-[NSManagedObjectContext(self=0x08ca8870, _cmd=0x000b4aec) MR_saveToPersistentStoreAndWait] + 49 at NSManagedObjectContext+MagicalSaves.m:33
    frame #13: 0x00085195 MyApp`-[NSManagedObjectContext(self=0x08ca8870, _cmd=0x06c6f906) MR_save] + 33 at NSManagedObjectContext+MagicalSaves.m:119
    frame #14: 0x00003149 MyApp`-[LPAppDelegate application:didFinishLaunchingWithOptions:](self=0x07f7eea0, _cmd=0x00fc696a, application=0x08a5d140, launchOptions=0x00000000) + 729 at LPAppDelegate.m:33
    frame #15: 0x00b199d6 UIKit`-[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1292
    frame #16: 0x00b1a8a6 UIKit`-[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 508
    frame #17: 0x00b29743 UIKit`-[UIApplication handleEvent:withNewEvent:] + 1027
    frame #18: 0x00b2a1f8 UIKit`-[UIApplication sendEvent:] + 68
    frame #19: 0x00b1daa9 UIKit`_UIApplicationHandleEvent + 8196
    frame #20: 0x023b2fa9 GraphicsServices`PurpleEventCallback + 1274
    frame #21: 0x01a271c5 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
    frame #22: 0x0198c022 CoreFoundation`__CFRunLoopDoSource1 + 146
    frame #23: 0x0198a90a CoreFoundation`__CFRunLoopRun + 2218
    frame #24: 0x01989db4 CoreFoundation`CFRunLoopRunSpecific + 212
    frame #25: 0x01989ccb CoreFoundation`CFRunLoopRunInMode + 123
    frame #26: 0x00b1a2a7 UIKit`-[UIApplication _run] + 576
    frame #27: 0x00b1ba9b UIKit`UIApplicationMain + 1175
    frame #28: 0x00002cbd MyApp`main(argc=1, argv=0xbffff3a4) + 141 at main.m:6
    frame #29: 0x00002be5 MyApp`___lldb_unnamed_function1$$MyApp + 53

Anyone knows why?

A custom class of mine implemented [NSManagedObjectContext defaultContext] and it had not been thoroughly removed from the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment