本文介绍了Cocoa:在_NSDisplayOperationStack中崩溃;需要指导的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到来自以下用户的崩溃报告:

I'm receiving crash reports from users that look like this:

Code Type:       X86-64 (Native)
Parent Process:  launchd [223]

Date/Time:       2012-03-22 11:28:33.087 +0800
OS Version:      Mac OS X 10.7.3 (11D50)
Report Version:  9

Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: 0x000000000000000d, 0x0000000000000000

VM Regions Near 0:
--> 
    __TEXT                 000000010c202000-000000010c29c000 [  616K] r-x/rwx SM=COW      /Applications/CodeKit.app/Contents/MacOS/CodeKit

Application Specific Information:
objc_msgSend() selector name: release
objc[22113]: garbage collection is OFF

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib                 0x00007fff904f5390 objc_msgSend_vtable14 + 16
1   com.apple.Foundation            0x00007fff8f664137 empty + 61
2   com.apple.Foundation            0x00007fff8f666c10 dealloc + 24
3   com.apple.Foundation            0x00007fff8f666bd1 -[NSConcreteMapTable dealloc] + 64
4   com.apple.AppKit                0x00007fff892bc52c -[_NSDisplayOperation dealloc] + 84
5   com.apple.CoreFoundation        0x00007fff8fdc7ca0 CFRelease + 176
6   com.apple.CoreFoundation        0x00007fff8fdf0742 -[__NSArrayM removeObjectAtIndex:]     + 434
7   com.apple.AppKit                0x00007fff892bc408 -[_NSDisplayOperationStack     exitDisplayOperationForWindow:] + 417
8   com.apple.AppKit                0x00007fff892be2fc -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] + 7136
9   com.apple.AppKit                0x00007fff892b6429 -[NSView displayIfNeeded] + 1676
10  [SEE DISCUSSION BELOW]






讨论



第10行和以下行报告之间差别很大(因此与崩溃无关)。但是,从第1行到第9行的序列总是相同的。每个崩溃包含这个确切的顺序。我已经搜索了_NSDisplayOperationStack,我发现了类似的崩溃报告,包括众多应用程序(包括Omni应用程序和Apple的Motion等)。


Discussion

Lines 10 and below vary wildly between reports (and hence are unrelated to the crash). However, the sequence from lines 1 to 9 is always the same. Every crash contains this exact sequence. I've googled "_NSDisplayOperationStack" and I've found similar crash reports for dozens of apps (including well-known ones such as Omni apps and Apple's Motion.)

因为崩溃来自Core Foundation,我不知道从哪里开始寻找问题。它似乎是深入可可的私人视图绘图机。更糟的是,我不能在我的机器上复制崩溃,所以我不能跟踪仪器。但是我收到了许多关于上述模式的报告,所以我知道这是一个问题。更糟的是,用户甚至不能可靠地重现崩溃 - 它是完全断断续续。

Because the crash is coming from Core Foundation, I have no idea where to begin looking for the problem. It seems to be deep inside Cocoa's private view-drawing machinery. Worse still, I can't replicate the crash on my machine at all, so I can't trace it with Instruments. But I've received many reports with the pattern above, so I know it's a problem. Worse STILL, the users can't even reproduce the crash reliably -- it's completely intermittent.

我希望上面的序列看起来很熟悉的人,他们可以给我指导从哪里开始寻找问题。谢谢。

I'm hoping the above sequence looks familiar to someone and they can give me guidance on where to start looking for the problem. Thank you.

推荐答案

我在苹果开发者论坛上发布了同样的问题,一位工程师告诉我,跟踪与并发视图绘图有关,这是10.6中引入的一个功能。

I posted this same question over at the Apple Developer forums and one engineer told me that it looked like the stack trace had to do with concurrent view drawing, which is a feature that was introduced in 10.6.

我浏览了所有的NIB文件,发现两个NSButton实例这是不是有意的;我必须在某个时候偶然检查过这个盒子。

I went through all of my NIB files and found two NSButton instances that were set to draw concurrently --- this was not intentional; I must have checked that box by accident at some point.

我禁用了他们的并发绘图,这个崩溃神奇地消失了。

I disabled the concurrent drawing for both of them and this crash has magically disappeared.

这篇关于Cocoa:在_NSDisplayOperationStack中崩溃;需要指导的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 10:19