【发布时间】:2012-03-01 08:06:47
【问题描述】:
我的想法不多了。我在使用 ARC 的项目中收到EXC_BAD_ACCESS。根据调试器,它在main() 内。 NSZombieEnabled 设置为 YES 但我没有看到任何调用堆栈或类/类型或任何东西。检查员/个人资料也是如此。我得到的只是应用程序崩溃后的某个时间“会话超时”。
而且在我的代码中很难找到。
我正在设置类似的跟踪
NSLog(@"CrashLog: <%@:%@:%d:%s>", NSStringFromClass([self class]),
NSStringFromSelector(_cmd), __LINE__, __FILE__);
我的所有代码都在方法的入口和出口上,但我还没有发现任何有用的模式。我所能看到的是,当EXC_BAD_ACCESS 被抛出时,我所有有问题的方法都已经被留下了。
关于如何隔离问题的任何想法?
Tim 建议在 gdb 中使用回溯 (bt)。结果是:
#0 0x0be87580 in TI::Favonius::BeamSearch::choose_hit_test_node ()
#1 0x0be87b5f in TI::Favonius::BeamSearch::update_for_touch ()
#2 0x0be8ee32 in TI::Favonius::StrokeBuildManager::update_search_for_touch ()
#3 0x0be8f58f in TI::Favonius::StrokeBuildManager::key_down_or_drag_hit_test_for_UI ()
#4 0x0be6ba8b in TIInputManagerZephyr::simulate_touches_for_input_string ()
#5 0x0be7e5d9 in -[TIKeyboardInputManagerZephyr candidates] ()
#6 0x00678345 in -[UIKeyboardImpl generateAutocorrectionReplacements:] ()
#7 0x007dcaec in __71-[UITextInteractionAssistant scheduleReplacementsForRange:withOptions:]_block_invoke_0 ()
#8 0x007f6db2 in -[UITextSelectionView calculateAndShowReplacements:] ()
#9 0x00e255fd in __NSFireDelayedPerform ()
#10 0x01a03976 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ ()
#11 0x01a03417 in __CFRunLoopDoTimer ()
#12 0x019667e0 in __CFRunLoopRun ()
#13 0x01965dd4 in CFRunLoopRunSpecific ()
#14 0x01965ceb in CFRunLoopRunInMode ()
#15 0x01ccb879 in GSEventRunModal ()
#16 0x01ccb93e in GSEventRun ()
#17 0x0050d38b in UIApplicationMain ()
#18 0x000033e0 in main (argc=1, argv=0xbffff5fc) at /Users/Hermann/AppDev/fcApp/fcApp/main.m:16
【问题讨论】:
标签: objective-c cocoa-touch debugging crash exc-bad-access