在Xcode中使用EXC_BAD_ACCESS崩溃 - 调试

时间:2015-02-10 07:28:01

标签: xcode cocoa lldb appkit nsautoreleasepool

我偶尔会遇到我的Mac应用程序崩溃,调试程序停止并从main.m捕获EXC_BAD_ACCESS错误。堆栈跟踪如下所示:

* thread #1: tid = 0x406ad1, 0x00007fff8be600d7 libobjc.A.dylib`objc_msgSend + 23, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x600036e8de50)
frame #0: 0x00007fff8be600d7 libobjc.A.dylib`objc_msgSend + 23
frame #1: 0x00007fff96edb93b AppKit`_NSPopoverCloseAndAnimate + 1102
frame #2: 0x00007fff9754cfed AppKit`-[NSPopover _geometryInWindowDidChangeForView:] + 166
frame #3: 0x00007fff8bb15cdc CoreFoundation`__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
frame #4: 0x00007fff8ba07244 CoreFoundation`_CFXNotificationPost + 3140
frame #5: 0x00007fff8ffa6c31 Foundation`-[NSNotificationCenter postNotificationName:object:userInfo:] + 66
frame #6: 0x00007fff96ca31c1 AppKit`-[NSView _invalidateFocus] + 421
frame #7: 0x00007fff96ca3c32 AppKit`-[NSView removeFromSuperview] + 469
frame #8: 0x00007fff96ea569a AppKit`-[NSWindow dealloc] + 1233
frame #9: 0x00007fff96ca9857 AppKit`-[NSWindow release] + 193
frame #10: 0x00007fff8ba0f9c0 CoreFoundation`CFRelease + 304
frame #11: 0x00007fff8ba23fad CoreFoundation`-[__NSArrayM dealloc] + 205
frame #12: 0x00007fff8be8089c libobjc.A.dylib`objc_object::sidetable_release(bool) + 236
frame #13: 0x00007fff8be66e8f libobjc.A.dylib`(anonymous namespace)::AutoreleasePoolPage::pop(void*) + 575
frame #14: 0x00007fff8ba31302 CoreFoundation`_CFAutoreleasePoolPop + 50
frame #15: 0x00007fff8ffbfedf Foundation`-[NSAutoreleasePool drain] + 153
frame #16: 0x00007fff96c7e661 AppKit`-[NSApplication run] + 800
frame #17: 0x00007fff96c69a14 AppKit`NSApplicationMain + 1832
frame #18: 0x0000000100003ec2 Contacts Journal Beta`main(argc=3, argv=0x00007fff5fbff670) + 34 at main.m:13
frame #19: 0x00007fff977c35c9 libdyld.dylib`start + 1

我已尝试使用NSZombieEnabled和Zombies乐器进行调试,但它们并没有帮助。但是调试器会在这个断点处停止(在极少数情况下我会遇到此崩溃),所以我想知道是否有任何我可以用调试器来获取有关哪个对象导致此崩溃的更多信息这是为什么。

会喜欢一些lldb提示。另外,有没有办法强迫" NSAutoreleasePool排水"这似乎是堆栈跟踪的一部分?在我看来,这是问题的最初原因,因此任何修复都必须触发自动释放排放(在我的应用程序中使用ARC)。

0 个答案:

没有答案