gpt4 book ai didi

iphone - EXC_BAD_ACCESS 在 iPhone 上但不在模拟器上

转载 作者:行者123 更新时间:2023-12-03 20:56:35 27 4
gpt4 key购买 nike

当我在设备(iPhone 4)上运行应用程序时,我得到了这个 exc_bad_access 。我尝试通过将 NSZombieEnabled 设置为 YES 来启用僵尸。应用程序因 exc_bad_access 崩溃,但没有给我崩溃的原因。

我修复了使用 clang 分析器标记的构建和分析、扫描构建的所有错误。在模拟器上运行得非常好。应用程序使用 libxml2 解析 xml 并在 UITableView 上显示内容。任何帮助将不胜感激。

更新:添加(gdb)信息线程响应。还有其他方法可以调试我错过的 EXC_BAD_ACCESS 吗?

(gdb) bt
#0 0x33a0daba in CALayerStateRelease ()
#1 0x339f3d9e in CALayerFreeTransaction ()
#2 0x339f3330 in CA::Transaction::commit ()
#3 0x33a179bc in CA::Transaction::observer_callback ()
#4 0x3082823c in __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ ()
#5 0x308280b0 in __CFRunLoopDoObservers ()
#6 0x3081f28c in CFRunLoopRunSpecific ()
#7 0x3081f17e in CFRunLoopRunInMode ()
#8 0x31e445f2 in GSEventRunModal ()
#9 0x31e4469e in GSEventRun ()
#10 0x31e51122 in -[UIApplication _run] ()
#11 0x31e4f12e in UIApplicationMain ()
#12 0x0000285e in main (argc=1, argv=0x2ffff53c) at /Users/Home/Desktop/ProductNavigation_libxml2_regular/main.m:14
(gdb) info threads
6 (Thread 0x770b: user=0.000000 system=0.000000 cpu=0 sleep_time=0) 0x3027a19c in __workq_kernreturn ()
5 (Thread 0x6e07: user=0.010000 system=0.010000 cpu=0 sleep_time=0) 0x30224060 in select$DARWIN_EXTSN ()
4 (Thread 0x6103: user=0.030000 system=0.030000 cpu=0 sleep_time=0) 0x301ffc98 in mach_msg_trap ()
3 (Thread 0x2003: user=0.000000 system=0.000000 cpu=0 sleep_time=0) 0x301ffc98 in mach_msg_trap ()
2 (Thread 0x1703: user=0.000000 system=0.000000 cpu=0 sleep_time=0) 0x3022c330 in kevent ()
* 1 (Thread 0x0307: user=1.160000 system=1.160000 cpu=0 sleep_time=0) 0x33a0daba in CALayerStateRelease ()
(gdb)

更新#2:另一个指向 UITableView 的堆栈跟踪

#0  0x3002d844 in objc_msgSend_stret ()
#1 0x31ed5b8e in -[UITableViewCellLayoutManager(UITableViewCellLayoutManagerStatic) _editingAccessoryRectForCell:offscreen:] ()
#2 0x31ed5374 in -[UITableViewCellLayoutManager(UITableViewCellLayoutManagerStatic) _reorderSeparatorRectForCell:offscreen:] ()
#3 0x31ed5266 in -[UITableViewCellLayoutManager reorderSeparatorEndingRectForCell:forNewEditingState:] ()
#4 0x31ed48ae in -[UITableViewCellLayoutManager layoutSubviewsOfCell:] ()
#5 0x3206ae24 in -[UITableViewCellLayoutManagerSubtitle layoutSubviewsOfCell:] ()
#6 0x31ed37c0 in -[UITableViewCell layoutSubviews] ()
#7 0x31e5cbc6 in -[UIView(CALayerDelegate) _layoutSublayersOfLayer:] ()
#8 0x308362ea in -[NSObject(NSObject) performSelector:withObject:] ()
#9 0x339f9948 in -[CALayer layoutSublayers] ()
#10 0x339f9700 in CALayerLayoutIfNeeded ()
#11 0x339f34ca in CA::Context::commit_transaction ()
#12 0x339f32e0 in CA::Transaction::commit ()
#13 0x33a179bc in CA::Transaction::observer_callback ()
#14 0x3082823c in __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ ()
#15 0x308280b0 in __CFRunLoopDoObservers ()
#16 0x3081f6ba in __CFRunLoopRun ()
#17 0x3081f276 in CFRunLoopRunSpecific ()
#18 0x3081f17e in CFRunLoopRunInMode ()
#19 0x31e445f2 in GSEventRunModal ()
#20 0x31e4469e in GSEventRun ()
#21 0x31e51122 in -[UIApplication _run] ()
#22 0x31e4f12e in UIApplicationMain ()

最佳答案

让它在启用 NSZombies 的情况下运行,然后检查在应该释放时释放的内容(这确实听起来像是内存问题,特别是因为堆栈跟踪)。

找到源代码后,修复它并高兴:)

关于iphone - EXC_BAD_ACCESS 在 iPhone 上但不在模拟器上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4821146/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com