SFly
SFly

Reputation: 1

when __NSDictionaryM dealloc crash

For a crash in my application, NSDictionary is an attribute of the model, and when the model executes the cxx_destruct function, crash occurs inside the NSDictionary.There's a place in the crash stack that I'm not sure about cow_cleanup, what's going on in this function? And The reason for the crash is that during the model release process, NSDictionary changed, right? Here is the concrete Crash stack Thread 0 Crashed:

0   libobjc.A.dylib                 objc_release + 16
1   CoreFoundation                  cow_cleanup + 168
2   CoreFoundation                  -[__NSDictionaryM dealloc] + 144
3   imeituan                        -[CKContent .cxx_destruct] (CKContent.m:12)
4   libobjc.A.dylib                 object_cxxDestructFromClass(objc_object*, objc_class*) + 112
5   libobjc.A.dylib                 objc_destructInstance + 88
6   libobjc.A.dylib                 _objc_rootDealloc + 52
7   imeituan                        -[CKTableViewCell .cxx_destruct] (CKTableViewCell.m:44)
8   libobjc.A.dylib                 object_cxxDestructFromClass(objc_object*, objc_class*) + 112
9   libobjc.A.dylib                 objc_destructInstance + 88
10  libobjc.A.dylib                 _objc_rootDealloc + 52
11  UIKitCore                       -[UIResponder dealloc] + 152
12  UIKitCore                       -[UIView dealloc] + 872
13  UIKitCore                       -[UITableViewCell dealloc] + 236
14  imeituan                        -[CKBubbleCell dealloc (CKBubbleCell.m:222)
15  CoreFoundation                  -[__NSArrayM dealloc] + 228
16  UIKitCore                       -[UITableView .cxx_destruct] + 1524
17  libobjc.A.dylib                 object_cxxDestructFromClass(objc_object*, objc_class*) + 112
18  libobjc.A.dylib                 objc_destructInstance + 88
19  libobjc.A.dylib                 _objc_rootDealloc + 52
20  UIKitCore                       -[UIResponder dealloc] + 152
21  UIKitCore                       -[UIView dealloc] + 872
22  UIKitCore                       -[UIScrollView dealloc] + 852
23  UIKitCore                       -[UITableView dealloc] + 364
24  UIKitCore                       __destroy_helper_block_e8_32s40s + 24
25  libsystem_blocks.dylib          _Block_release + 148
26  Foundation                      -[_NSTimerBlockTarget dealloc] + 44
27  Foundation                      _timerRelease + 64
28  CoreFoundation                  __CFRunLoopDoTimer + 936
29  CoreFoundation                  __CFRunLoopDoTimers + 276
30  CoreFoundation                  __CFRunLoopRun + 1640
31  CoreFoundation                  CFRunLoopRunSpecific + 424
32  GraphicsServices                GSEventRunModal + 160
33  UIKitCore                       UIApplicationMain + 1932
34  imeituan                        main (main.m:38)
35  libdyld.dylib                   start + 4

Upvotes: 0

Views: 1163

Answers (1)

Mattie
Mattie

Reputation: 3028

Crashes like this are really tricky. The key to keep in mind is that you are crashing during a deallocation. And, more specifically, the crashing function is objc_release. To me, this strongly indicates that you've got an over-released object. It's looks to me like one of your model objects may have already been freed by this point. The issue isn't with the dictionary, directly.

I'd recommend using NSZombies, or one of the other memory allocation tools within Instruments to try to track down where your memory-management issue is.

Upvotes: 0

Related Questions