有时,我仅在模拟器中遇到非常奇怪的崩溃(<= 4.3)。当我按下嵌入弹出窗口的导航控制器上的按钮时,就会发生这种情况。在弹出窗口下有一个正在渲染某些内容的 EAGLView。内存处理正确,等等......在设备上完全没有问题。
有什么想法吗?
这是一个调用堆栈:
* thread #1: tid = 0x2c03, 0x00ab6707 CoreGraphics`CGColorGetAlpha + 17, stop reason = EXC_BAD_ACCESS (code=1, address=0x1cc9b72c)
frame #0: 0x00ab6707 CoreGraphics`CGColorGetAlpha + 17
frame #1: 0x00dc9871 QuartzCore`-[CALayer _renderBackgroundInContext:] + 97
frame #2: 0x00dc97af QuartzCore`-[CALayer renderInContext:] + 977
frame #3: 0x00dcf15c QuartzCore`-[CALayer _renderSublayersInContext:] + 444
frame #4: 0x00dc97e1 QuartzCore`-[CALayer renderInContext:] + 1027
frame #5: 0x00dcf15c QuartzCore`-[CALayer _renderSublayersInContext:] + 444
frame #6: 0x00dc97e1 QuartzCore`-[CALayer renderInContext:] + 1027
frame #7: 0x003434a9 UIKit`-[UIView(Internal) _renderSnapshotWithRect:inContext:] + 790
frame #8: 0x0067776d UIKit`-[UIClipCornerView _updateSnapshot] + 697
frame #9: 0x0067723c UIKit`-[UIRoundedCornerView didMoveToSuperview] + 51
frame #10: 0x0033c750 UIKit`-[UIView(Internal) _addSubview:positioned:relativeTo:] + 1080
frame #11: 0x0033aaa3 UIKit`-[UIView(Hierarchy) addSubview:] + 57
frame #12: 0x004df1ad UIKit`-[UILayoutContainerView _beginFastMode] + 259
frame #13: 0x003c0c74 UIKit`-[UIViewController(UINavigationControllerItem) setEditing:animated:] + 249
frame #14: 0x0051453b UIKit`-[UITableViewController setEditing:animated:] + 73
frame #15: 0x003b6d1e UIKit`-[UIViewController(UINavigationControllerItem) _toggleEditing:] + 77
frame #16: 0x0030b4fd UIKit`-[UIApplication sendAction:to:from:forEvent:] + 119
frame #17: 0x0051dcc3 UIKit`-[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 156
frame #18: 0x0030b4fd UIKit`-[UIApplication sendAction:to:from:forEvent:] + 119
frame #19: 0x0039b799 UIKit`-[UIControl sendAction:to:forEvent:] + 67
frame #20: 0x0039dc2b UIKit`-[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
frame #21: 0x0039c7d8 UIKit`-[UIControl touchesEnded:withEvent:] + 458
frame #22: 0x0032fded UIKit`-[UIWindow _sendTouchesForEvent:] + 567
frame #23: 0x00310c37 UIKit`-[UIApplication sendEvent:] + 447
frame #24: 0x00315f2e UIKit`_UIApplicationHandleEvent + 7576
frame #25: 0x018f0992 GraphicsServices`PurpleEventCallback + 1550
frame #26: 0x00f79944 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
frame #27: 0x00ed9cf7 CoreFoundation`__CFRunLoopDoSource1 + 215
frame #28: 0x00ed6f83 CoreFoundation`__CFRunLoopRun + 979
frame #29: 0x00ed6840 CoreFoundation`CFRunLoopRunSpecific + 208
frame #30: 0x00ed6761 CoreFoundation`CFRunLoopRunInMode + 97
frame #31: 0x018ef1c4 GraphicsServices`GSEventRunModal + 217
frame #32: 0x018ef289 GraphicsServices`GSEventRun + 115
frame #33: 0x00319c93 UIKit`UIApplicationMain + 1160
还有一件事似乎很重要:当隐藏底层 EAGLView 时,它不会发生。 GLView 和 Popover 不共享任何数据 - 有趣,不是吗?我怀疑当按下按钮(“编辑”)想要重绘/切换到“蓝色”时就会出现这种情况,因为弹出框标题是一种半透明的,所以会发生一些混合。对我来说听起来像是模拟器问题;有人有过类似的事情吗?
感谢您的回答,
wl
Occasionally I am getting a really strange crash in the simulator only (<= 4.3). It happens when I press a button on a navigation controller embedded with in a popover. Under the popover there is an EAGLView which is rendering something. Memory is handled properly, etc... on device no problem at all.
Any idea?
Here is a call stack:
* thread #1: tid = 0x2c03, 0x00ab6707 CoreGraphics`CGColorGetAlpha + 17, stop reason = EXC_BAD_ACCESS (code=1, address=0x1cc9b72c)
frame #0: 0x00ab6707 CoreGraphics`CGColorGetAlpha + 17
frame #1: 0x00dc9871 QuartzCore`-[CALayer _renderBackgroundInContext:] + 97
frame #2: 0x00dc97af QuartzCore`-[CALayer renderInContext:] + 977
frame #3: 0x00dcf15c QuartzCore`-[CALayer _renderSublayersInContext:] + 444
frame #4: 0x00dc97e1 QuartzCore`-[CALayer renderInContext:] + 1027
frame #5: 0x00dcf15c QuartzCore`-[CALayer _renderSublayersInContext:] + 444
frame #6: 0x00dc97e1 QuartzCore`-[CALayer renderInContext:] + 1027
frame #7: 0x003434a9 UIKit`-[UIView(Internal) _renderSnapshotWithRect:inContext:] + 790
frame #8: 0x0067776d UIKit`-[UIClipCornerView _updateSnapshot] + 697
frame #9: 0x0067723c UIKit`-[UIRoundedCornerView didMoveToSuperview] + 51
frame #10: 0x0033c750 UIKit`-[UIView(Internal) _addSubview:positioned:relativeTo:] + 1080
frame #11: 0x0033aaa3 UIKit`-[UIView(Hierarchy) addSubview:] + 57
frame #12: 0x004df1ad UIKit`-[UILayoutContainerView _beginFastMode] + 259
frame #13: 0x003c0c74 UIKit`-[UIViewController(UINavigationControllerItem) setEditing:animated:] + 249
frame #14: 0x0051453b UIKit`-[UITableViewController setEditing:animated:] + 73
frame #15: 0x003b6d1e UIKit`-[UIViewController(UINavigationControllerItem) _toggleEditing:] + 77
frame #16: 0x0030b4fd UIKit`-[UIApplication sendAction:to:from:forEvent:] + 119
frame #17: 0x0051dcc3 UIKit`-[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 156
frame #18: 0x0030b4fd UIKit`-[UIApplication sendAction:to:from:forEvent:] + 119
frame #19: 0x0039b799 UIKit`-[UIControl sendAction:to:forEvent:] + 67
frame #20: 0x0039dc2b UIKit`-[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
frame #21: 0x0039c7d8 UIKit`-[UIControl touchesEnded:withEvent:] + 458
frame #22: 0x0032fded UIKit`-[UIWindow _sendTouchesForEvent:] + 567
frame #23: 0x00310c37 UIKit`-[UIApplication sendEvent:] + 447
frame #24: 0x00315f2e UIKit`_UIApplicationHandleEvent + 7576
frame #25: 0x018f0992 GraphicsServices`PurpleEventCallback + 1550
frame #26: 0x00f79944 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
frame #27: 0x00ed9cf7 CoreFoundation`__CFRunLoopDoSource1 + 215
frame #28: 0x00ed6f83 CoreFoundation`__CFRunLoopRun + 979
frame #29: 0x00ed6840 CoreFoundation`CFRunLoopRunSpecific + 208
frame #30: 0x00ed6761 CoreFoundation`CFRunLoopRunInMode + 97
frame #31: 0x018ef1c4 GraphicsServices`GSEventRunModal + 217
frame #32: 0x018ef289 GraphicsServices`GSEventRun + 115
frame #33: 0x00319c93 UIKit`UIApplicationMain + 1160
One more thing which seems to be important: when underlying EAGLView is hidden then it does not occur. GLView and Popover do not share any data - interesting, is not it? I suspect it comes when pressed button ("edit") wants to redraw/toggle to "blue" then some blending happens since popover heading is a kind of translucent. For me sounds like a simulator problem; anyone had anything like that?
Thanks for any answer,
wl
发布评论
评论(2)
设置 NSZombieEnabled,MallocStackLogging 和 在调试器中保护 malloc。然后,当您的应用程序崩溃时,在 gdb 控制台中输入以下内容:
将
0x543216
替换为导致崩溃的对象的地址(可能来自此行:* thread #1: tid = 0x2c03 , 0x00ab6707 CoreGraphics CGColorGetAlpha + 17, 停止原因 = EXC_BAD_ACCESS (代码=1, address=0x1cc9b72c)
),您将获得更有用的堆栈跟踪,它应该可以帮助您查明代码中导致问题的确切行。请参阅本文以获取更详细的说明。
Set NSZombieEnabled, MallocStackLogging, and guard malloc in the debugger. Then, when your App crashes, type this in the gdb console:
Replace
0x543216
with the address of the object that caused the crash (probably from this line:* thread #1: tid = 0x2c03, 0x00ab6707 CoreGraphics CGColorGetAlpha + 17, stop reason = EXC_BAD_ACCESS (code=1, address=0x1cc9b72c)
) and you will get a much more useful stack trace and it should help you pinpoint the exact line in your code that is causing the problem.See this article for more detailed instructions.
GDB 给了我类似的东西:
正如我们所看到的,涉及 EAGLView...
...事实上,经过一番挖掘后,我发现问题与 EAGLLayer 背景颜色有关。我声明如下:
在那之前这通常工作得很好。
我用:
或更短:
从那以后也不例外。
@chown:谢谢你的提示。
维
GDB gives me something like that:
As we can see EAGLView is involved...
...and in fact after some digging I figured out the problem was to do with EAGLLayer background color. I declared it as follows:
This generally worked fine until then.
I fixed it with:
or shorter:
Since then no exception.
@chown: thanks for your tip.
wl