marcoarment / FCModel

An alternative to Core Data for people who like having direct SQL access.
MIT License
1.65k stars 173 forks source link

objc_msgSend() selector name: set_rowValuesInDatabase: #87

Open rustyshelf opened 10 years ago

rustyshelf commented 10 years ago

Are there some rules around retaining FCModel objects that aren't in the documentation? I see crashes like this one: Exception Type: SIGSEGV Exception Codes: SEGV_ACCERR at 0x2000000c Crashed Thread: 0

Application Specific Information: objc_msgSend() selector name: set_rowValuesInDatabase:

Thread 0 Crashed:
0   libobjc.A.dylib                      0x3b36f626 objc_msgSend + 6
1   podcasts                             0x00166cd7 -[FCModel reload:] (FCModel.m:710)
2   CoreFoundation                       0x30bdd1f1 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 10
3   CoreFoundation                       0x30b5153f _CFXNotificationPost + 1716
4   Foundation                           0x3153ba3d -[NSNotificationCenter postNotificationName:object:userInfo:] + 74
5   podcasts                             0x00163671 __35+[FCModel dataWasUpdatedExternally]_block_invoke (FCModel.m:203)
6   libdispatch.dylib                    0x3b84d833 _dispatch_call_block_and_release + 8
7   libdispatch.dylib                    0x3b84d81f _dispatch_client_callout + 20
8   libdispatch.dylib                    0x3b85449f _dispatch_main_queue_callback_4CF$VARIANT$mp + 276
9   CoreFoundation                       0x30be58f1 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 6
10  CoreFoundation                       0x30be41c5 __CFRunLoopRun + 1298
11  CoreFoundation                       0x30b4ef0f CFRunLoopRunSpecific + 520
12  CoreFoundation                       0x30b4ecf3 CFRunLoopRunInMode + 104
13  GraphicsServices                     0x35a70663 GSEventRunModal + 136
14  UIKit                                0x3349a16d UIApplicationMain + 1134
15  podcasts                             0x00043ee7 main (main.m:14)
16  libdyld.dylib                        0x3b872ab7 start + 0

and it's cousin: Exception Type: SIGSEGV Exception Codes: SEGV_ACCERR at 0x7000000c Crashed Thread: 0

Application Specific Information: objc_msgSend() selector name: _rowValuesInDatabase

Thread 0 Crashed:
0   libobjc.A.dylib                      0x3a958626 objc_msgSend + 6
1   podcasts                             0x0013c849 __25-[FCModel unsavedChanges]_block_invoke (FCModel.m:790)
2   CoreFoundation                       0x30012093 __65-[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:]_block_invoke + 96
3   CoreFoundation                       0x30011fb7 -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 160
4   podcasts                             0x0013c767 -[FCModel unsavedChanges] (FCModel.m:787)
5   podcasts                             0x0013bdc5 -[FCModel reload:] (FCModel.m:714)
6   CoreFoundation                       0x300981f1 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 10
7   CoreFoundation                       0x3000c53f _CFXNotificationPost + 1716
8   Foundation                           0x309f6a3d -[NSNotificationCenter postNotificationName:object:userInfo:] + 74
9   podcasts                             0x00138671 __35+[FCModel dataWasUpdatedExternally]_block_invoke (FCModel.m:203)
10  libdispatch.dylib                    0x3ae36833 _dispatch_call_block_and_release + 8
11  libdispatch.dylib                    0x3ae3681f _dispatch_client_callout + 20
12  libdispatch.dylib                    0x3ae3d49f _dispatch_main_queue_callback_4CF$VARIANT$mp + 276
13  CoreFoundation                       0x300a08f1 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 6
14  CoreFoundation                       0x3009f1c5 __CFRunLoopRun + 1298
15  CoreFoundation                       0x30009f0f CFRunLoopRunSpecific + 520
16  CoreFoundation                       0x30009cf3 CFRunLoopRunInMode + 104
17  GraphicsServices                     0x34f62663 GSEventRunModal + 136
18  UIKit                                0x3295516d UIApplicationMain + 1134
19  podcasts                             0x00018ee7 main (main.m:14)
20  libdyld.dylib                        0x3ae5bab7 start + 0
duncandee commented 9 years ago

Did you manage to find a solution to this, I am experiencing this issue also. tx.

rustyshelf commented 9 years ago

@duncandee that was a long time ago, but I think it was caused by running batch SQL updates, and the notifications that got fired by FCModel after that. Since I didn't need all the notifications I commented that bit out. I say 'I think' because I honestly can't remember, sorry.

MohamedElzohirey commented 9 years ago

I think you may need to remove notification's rObserver "removeObserver" before you leave.