4

Since i received comments of crashes but the app never crashes for me, I now use critterism to hunt down crashes.

I received one report that pointed to me to an error by me. It was easy, since the method name was given and i could look in my code what might crash. So far, so good.

But i also have the following two that puzzle me.

To me it looks like the app crashes in some internal apple library.( Most likely due to me feeding it some broken stuff...)

There is no call from my code in the crash, so where do start looking?

Does anyone understand these crashes? Any idea how i can catch these and maybe get some more crash info? No.1:

0 CoreFoundation 0x3585f88f __exceptionPreprocess + 162
1 libobjc.A.dylib 0x37c06259 objc_exception_throw + 32
2 CoreFoundation 0x35862a9b -[NSObject doesNotRecognizeSelector:] + 174
3 CoreFoundation 0x35861915 ___forwarding___ + 300
4 CoreFoundation 0x357bc650 _CF_forwarding_prep_0 + 48
5 UIKit 0x332f3efb -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 546
6 UIKit 0x332f2f39 -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 916
7 UIKit 0x332f2763 -[UITableView layoutSubviews] + 206
8 UIKit 0x33296f37 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 182
9 CoreFoundation 0x357be1fb -[NSObject performSelector:withObject:] + 42
10 QuartzCore 0x3268eaa5 -[CALayer layoutSublayers] + 216
11 QuartzCore 0x3268e6bd _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 216
12 QuartzCore 0x32692843 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 226
13 QuartzCore 0x3269257f _ZN2CA11Transaction6commitEv + 314
14 QuartzCore 0x326ba911 _ZN2CA11Transaction5flushEv + 44
15 QuartzCore 0x326ba8e3 +[CATransaction flush] + 34
16 UIKit 0x332a1fb1 _afterCACommitHandler + 52
17 CoreFoundation 0x35833b1b __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18
18 CoreFoundation 0x35831d57 __CFRunLoopDoObservers + 258
19 CoreFoundation 0x358320b1 __CFRunLoopRun + 760
20 CoreFoundation 0x357b54a5 CFRunLoopRunSpecific + 300
21 CoreFoundation 0x357b536d CFRunLoopRunInMode + 104
22 GraphicsServices 0x37451439 GSEventRunModal + 136
23 UIKit 0x332c1cd5 UIApplicationMain + 1080
24 Wohnungssuche 0x000d5218 start + 40

No. 2:

Thread: Unknown Name (Crashed)
0     libobjc.A.dylib                       0x35beb5d0 objc_msgSend + 16 + 15
1     UIKit                                 0x39fb0541 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 409 + 408
2     UIKit                                 0x39f95361 -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 1317 + 1316
3     UIKit                                 0x39fac7ff -[UITableView layoutSubviews] + 207 + 206
4     UIKit                                 0x39f68897 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 259 + 258
5     QuartzCore                            0x34ab74eb -[CALayer layoutSublayers] + 215 + 214
6     QuartzCore                            0x34ab708d _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 461 + 460
7     QuartzCore                            0x34ab7fb1 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 17 + 16
8     QuartzCore                            0x34ab799b _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 239 + 238
9     QuartzCore                            0x34ab77ad _ZN2CA11Transaction6commitEv + 317 + 316
10   QuartzCore                             0x34aee7df _ZN2CA7Display11DisplayLink8dispatchEyy + 255 + 254
11   QuartzCore                             0x34aee6d9 _ZN2CA7Display16IOMFBDisplayLink8callbackEP21__IOMobileFramebufferyyyPv + 65 + 64
12   IOMobileFramebuffer                    0x375f0fd7 IOMobileFramebufferVsyncNotifyFunc + 155 + 154
13   IOKit                                  0x3282a5ad IODispatchCalloutFromCFMessage + 193 + 192
14   CoreFoundation                         0x3918288b __CFMachPortPerform + 119 + 118
15   CoreFoundation                         0x3918d3e7 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 35 + 34
16   CoreFoundation                         0x3918d38b __CFRunLoopDoSource1 + 139 + 138
17   CoreFoundation                         0x3918c20f __CFRunLoopRun + 1383 + 1382
18   CoreFoundation                         0x390ff23d CFRunLoopRunSpecific + 357 + 356
19   CoreFoundation                         0x390ff0c9 CFRunLoopRunInMode + 105 + 104
20   GraphicsServices                       0x3344933b GSEventRunModal + 75 + 74
21   UIKit                                  0x39fb9291 UIApplicationMain + 1121 + 1120    

Thanks for your help!

Sebastian
  • 966
  • 11
  • 19
  • 1
    Number 1 I would focus on "[NSObject doesNotRecognizeSelector:]" which seems to indicate that you've set a delegate that doesn't implement one of the UITableView methods that it's expecting – Mike M Jan 30 '13 at 19:08
  • From outside, I feel that 1) is because you are loading data on your tableview (reloading it rather ) from one of your methods and that method call is leading it to a crash and that method is displaying a CALayer stuff on it, and doing some sort of animation on it which is breaking it up. 2) looks quiet similar to first one. however some code would let us get through the issue. Are you able to replicate this crash? If so, then check it out by enabling zombies? – Reno Jones Jan 30 '13 at 19:10
  • 1
    Yes, and unless UIKit is looking for an apartment to rent, I don't think Wohnungssuche is an internal apple library... – HackyStack Jan 30 '13 at 19:10
  • no i can not replicate the crash. :( – Sebastian Jan 30 '13 at 19:14
  • @HackyStack yes i am aware that it is my app which crashes, but the crash happens somewhere after "_createPreparedCellForGlobalRow:withIndexPath:]" and no calls from my code exept "start" are shown – Sebastian Jan 30 '13 at 19:17
  • Are you doing any CALayer animations on tableview cells in one of your methods? If so then wrap the code around Try-Catch block and then use the application for a while and then see if you get a crash or what do you see in your logs? – Reno Jones Jan 30 '13 at 19:17
  • I have been using the app for very long time on 2 different iPhones and i can not get it to crash :( That is the whole point of me using critterism now. And i don't do any animation in the tableviews... – Sebastian Jan 30 '13 at 19:36
  • Did you figure the reason for crash 2 in the end ? I have the same issue. – VBK Apr 19 '13 at 08:30

1 Answers1

3

The crash point in both cases is the same:

 UIKit 0x39fb0541 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 409 + 408

In the first case, the table view was trying to call a method on an instance that does not implement said method. The second crash was caused by trying to message garbage.

Thus, the most likely conclusion is that both crashes are symptoms of a single problem; you have an object that is being prematurely released or over-released.

In particular, your table view's data source is being released before or while a table is reloading.

I suspect that UITableView is trying to call the data source's method to create a cell. You could confirm this by setting a breakpoint on said method and looking at the stack trace. If my bet is correct, you'll see the _createPreparedCellForGlobal... method in the trace.


Without knowing details of your app, hard to say. Most likely, this is timing related issue between data being loaded on the screen and the user doing something that causes a request to be canceled earlier than the table view is done loading, causing your data source to be deallocated out from under the table (which can happen because the table view has an assign reference to your object; a non-retaining reference).

To try and reproduce, focus on:

• slow network connection or variable bandwidth (if your app is client/server)

• do things the user might do that causes operations to cancel

• quickly navigate between views without waiting for the update to complete drawing

In your comments, you mention that you are trying on "two different iPhones". Try on other device types and across different network configurations.

bbum
  • 162,346
  • 23
  • 271
  • 359
  • my app uses several TableViews. I set breakpoints on 2 in the cellForRowAtIndexPath and both times the stack shows the method "_createPreparedCellForGlobal". so i guess it is used in every tableview. I don't even know which tableview crashes :( My project uses ARC, so it can not be me who releases the object too early. I did run the static analysis, but it did not come up with problems in my code. – Sebastian Jan 30 '13 at 19:33
  • But what can happen is that you are causing parts of your app to be torn down prematurely. The `dataSource` of a UITableView is declared as `assign`; it is not retained. Thus, your data source could easily be torn down before the tableview is done with it. – bbum Jan 30 '13 at 21:19