神奇记录崩溃:NSManagedObjectContext队列EXC_BAD_ACCESS KERN_INVALID_A



我正在使用Magical Record进行核心数据操作。

我在下面发布的崩溃似乎只会发生在iOS7中。EXC_BAD_ACCESS KERN_INVALID_ADRESS表示某个对象被释放。我不太确定虫子在哪里。对此有什么想法吗?谢谢

Thread : Crashed: NSManagedObjectContext Queue
0  libobjc.A.dylib                0x39d7c636 objc_msgSend + 21
1  Foundation                     0x2fee4d9d -[NSError dealloc] + 60
2  libobjc.A.dylib                0x39d81b6b objc_object::sidetable_release(bool) + 174
3  libobjc.A.dylib                0x39d820d7 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 358
4  CoreFoundation                 0x2f4f5c19 _CFAutoreleasePoolPop + 16
5  Foundation                     0x2feef637 -[NSAutoreleasePool drain] + 122
6  CoreData                       0x2f336fb9 -[NSManagedObjectContext save:] + 944
7  Branch                         0x20f87d __70-[NSManagedObjectContext(MagicalSaves) MR_saveWithOptions:completion:]_block_invoke20 (NSManagedObjectContext+MagicalSaves.m:82)
8  CoreData                       0x2f39a935 developerSubmittedBlockToNSManagedObjectContextPerform + 88
9  CoreData                       0x2f39aa7b -[NSManagedObjectContext performBlockAndWait:] + 114
10 Branch                         0x20f621 -[NSManagedObjectContext(MagicalSaves) MR_saveWithOptions:completion:] (NSManagedObjectContext+MagicalSaves.m:128)
11 CoreData                       0x2f39a935 developerSubmittedBlockToNSManagedObjectContextPerform + 88
12 libdispatch.dylib              0x3a26cdd7 _dispatch_barrier_sync_f_invoke + 26
13 CoreData                       0x2f39aa73 -[NSManagedObjectContext performBlockAndWait:] + 106
14 Branch                         0x205831 +[MagicalRecord(Actions) saveWithBlockAndWait:] (MagicalRecord+Actions.m:44)
15 Branch                         0x1acdbb __62-[BREmployeeDataController getPositionsAtLocation:completion:]_block_invoke (BREmployeeDataController.m:42)
16 Branch                         0x1ad87d __66-[BREmployeeDataController synchronizeStaffAtLocation:completion:]_block_invoke (BREmployeeDataController.m:193)
17 Branch                         0x1d215b __116-[AFHTTPSessionManager dataTaskWithHTTPMethod:URLString:parameters:uploadProgress:downloadProgress:success:failure:]_block_invoke80 (AFHTTPSessionManager.m:287)
18 Branch                         0x1e326b __72-[AFURLSessionManagerTaskDelegate URLSession:task:didCompleteWithError:]_block_invoke_2150 (AFURLSessionManager.m:308)
19 libdispatch.dylib              0x3a25a833 _dispatch_call_block_and_release + 10
20 libdispatch.dylib              0x3a25a81f _dispatch_client_callout + 22
21 libdispatch.dylib              0x3a25a777 _dispatch_main_queue_callback_4CF$VARIANT$up + 254
22 CoreFoundation                 0x2f58c8a1 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
23 CoreFoundation                 0x2f58b175 __CFRunLoopRun + 1300
24 CoreFoundation                 0x2f4f5ebf CFRunLoopRunSpecific + 522
25 CoreFoundation                 0x2f4f5ca3 CFRunLoopRunInMode + 106
26 GraphicsServices               0x343fb663 GSEventRunModal + 138
27 UIKit                          0x31e4214d UIApplicationMain + 1136
28 Branch                         0x1a6437 main (main.m:14)
29 libdyld.dylib                  0x3a27fab7 start + 2

您在使用ARC吗?MagicalRecord使用ARC吗?

您或MagicalRecord正在过度释放某个NSAutoreleasePool认为其拥有的对象。然后,池会弹出(当NSManagedObjectContext完成save:操作时),其中一个对象是垃圾。尝试在启用NSZombies的情况下运行,或者使用Allocations Instrument来确定哪个对象被过度释放。

最新更新