How to understand this crash log

六眼飞鱼酱① 提交于 2019-12-03 13:18:08

Reading stack frames that aren't in your code often borders on reading tea leaves, but in this case, it's pretty clear what happened.

I'm going to read your crash log to you, translating as I go along.

The stack is built up from the bottom up (just like stacks in the real world). I'll cut to the chase:

10  com.apple.CoreFoundation        0x00007fff875478bd __CFRunLoopDoTimer + 557
9   com.apple.CoreFoundation        0x00007fff87547da4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20

A timer fired.

8   com.apple.AppKit                0x00007fff8da6e463 -[NSTableRowData _idleUpdateVisibleRows] + 66
7   com.apple.AppKit                0x00007fff8da5a8a1 -[NSTableRowData updateVisibleRowViews] + 119
6   com.apple.AppKit                0x00007fff8da5aa85 -[NSTableRowData _unsafeUpdateVisibleRowEntries] + 96
5   com.apple.AppKit                0x00007fff8da5b3cb _NSTVVisibleRowsForUpdate + 296

In this timer (which is presumably set to fire during idle time), the table view attempts to update its knowledge of which rows are visible.

(The last frame is the one that clarifies that it's updating which rows are visible, not updating the rows that are visible. You can tell this from the wording of the function's name.)

4   com.apple.AppKit                0x00007fff8da418e8 -[NSTableView rectOfRow:] + 288

To determine whether a row is visible, the view needs to figure out where that row is within its bounds (presumably to intersect with its visible rectangle within the scroll view).

Toward that end, the table view is attempting to figure out the characteristics of this row:

3   com.apple.AppKit                0x00007fff8da41fad -[NSTableView _isSourceListGroupRow:] + 56

Is it a source list group row?

2   com.apple.AppKit                0x00007fff8da46878 -[NSTableView _isGroupRow:] + 81

Is it any group row at all?

1   com.apple.AppKit                0x00007fff8dac6e27 -[NSOutlineView _delegate_isGroupRow:] + 66

Let's ask the delegate.

0   libobjc.A.dylib                 0x00007fff877a5256 objc_msgSend + 22

Attempting to send a message. This is where your process crashed.

So, the crash occurred while the outline view was trying to send a message to its delegate.

From this, we can derive three facts:

  1. The view in question is an outline view, not a non-outline table view. (Frame #1 proves this. A regular table view isn't an NSOutlineView.) This alone may identify the view involved, but if it doesn't, no biggie, because we have another fact that may narrow it down.
  2. The outline view in question has a delegate. This alone may identify the outline view involved, but if it doesn't, no biggie, because the problem isn't with the view at all.
  3. The problem is that the object that is the view's delegate is insufficiently owned. It dies prematurely before the outline view can send it the message we saw in the stack trace.

Use Instruments's Zombies template to determine which object the outline view is trying to talk to, and to look over the history of that object to find the undue or unbalanced release that killed it. You probably need to add a strong ownership of that object somewhere.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!