Memory leaks xCode&;iOS:使用泄漏进行调试

Memory leaks xCode&;iOS:使用泄漏进行调试,memory-leaks,instruments,xcode4.5,Memory Leaks,Instruments,Xcode4.5,我正在使用仪器工具(泄漏)来诊断泄漏,但我不太明白如何回溯到我的代码。有人知道我如何进一步诊断吗 在iPad(iOS 4.3.5)上使用Xcode 4.5和评测 更新:以下是回溯: thread #4: tid = 0x3203, 0x35dffd7a libicucore.A.dylib`utext_hasMetaData + 546, stop reason = EXC_BAD_ACCESS (code=2, address=0x0) frame #0: 0x35dffd7a lib

我正在使用仪器工具(泄漏)来诊断泄漏,但我不太明白如何回溯到我的代码。有人知道我如何进一步诊断吗

在iPad(iOS 4.3.5)上使用Xcode 4.5和评测

更新:以下是回溯:

thread #4: tid = 0x3203, 0x35dffd7a libicucore.A.dylib`utext_hasMetaData + 546, stop reason = EXC_BAD_ACCESS (code=2, address=0x0)
    frame #0: 0x35dffd7a libicucore.A.dylib`utext_hasMetaData + 546
    frame #1: 0x003c17d0
    frame #2: 0x35da6746 libicucore.A.dylib`icu::RuleBasedBreakIterator::handleNext(icu::RBBIStateTable const*) + 806
    frame #3: 0x35da6406 libicucore.A.dylib`icu::RuleBasedBreakIterator::next() + 82
    frame #4: 0x35da5cde libicucore.A.dylib`icu::RuleBasedBreakIterator::following(int) + 218
    frame #5: 0x35db0538 libicucore.A.dylib`ubrk_following + 8
    frame #6: 0x32bb0bc8 WebCore`WebCore::textBreakFollowing(WebCore::TextBreakIterator*, int) + 8
    frame #7: 0x32b9baee WebCore`WebCore::nextBreakablePosition(unsigned short const*, int, int, bool) + 270
    frame #8: 0x32bd0dc8 WebCore`WebCore::RenderBlock::findNextLineBreak(WebCore::BidiResolver<WebCore::InlineIterator, WebCore::BidiRun>&, bool, bool&, bool&, bool&, WebCore::EClear*) + 6920
    frame #9: 0x32b8ce02 WebCore`WebCore::RenderBlock::layoutInlineChildren(bool, int&, int&) + 1922
    frame #10: 0x32b8a1ae WebCore`WebCore::RenderBlock::layoutBlock(bool) + 690
    frame #11: 0x32b897c2 WebCore`WebCore::RenderBlock::layout() + 26
    frame #12: 0x32b8b956 WebCore`WebCore::RenderBlock::layoutBlockChild(WebCore::RenderBox*, WebCore::RenderBlock::MarginInfo&, int&, int&) + 414
    frame #13: 0x32b8b24c WebCore`WebCore::RenderBlock::layoutBlockChildren(bool, int&) + 428
    frame #14: 0x32b8a1bc WebCore`WebCore::RenderBlock::layoutBlock(bool) + 704
    frame #15: 0x32b897c2 WebCore`WebCore::RenderBlock::layout() + 26
    frame #16: 0x32b8b956 WebCore`WebCore::RenderBlock::layoutBlockChild(WebCore::RenderBox*, WebCore::RenderBlock::MarginInfo&, int&, int&) + 414
    frame #17: 0x32b8b24c WebCore`WebCore::RenderBlock::layoutBlockChildren(bool, int&) + 428
    frame #18: 0x32b8a1bc WebCore`WebCore::RenderBlock::layoutBlock(bool) + 704
    frame #19: 0x32b897c2 WebCore`WebCore::RenderBlock::layout() + 26
    frame #20: 0x32b8b956 WebCore`WebCore::RenderBlock::layoutBlockChild(WebCore::RenderBox*, WebCore::RenderBlock::MarginInfo&, int&, int&) + 414
    frame #21: 0x32b8b24c WebCore`WebCore::RenderBlock::layoutBlockChildren(bool, int&) + 428
    frame #22: 0x32b8a1bc WebCore`WebCore::RenderBlock::layoutBlock(bool) + 704
    frame #23: 0x32b897c2 WebCore`WebCore::RenderBlock::layout() + 26
    frame #24: 0x32b8b956 WebCore`WebCore::RenderBlock::layoutBlockChild(WebCore::RenderBox*, WebCore::RenderBlock::MarginInfo&, int&, int&) + 414
    frame #25: 0x32b8b24c WebCore`WebCore::RenderBlock::layoutBlockChildren(bool, int&) + 428
    frame #26: 0x32b8a1bc WebCore`WebCore::RenderBlock::layoutBlock(bool) + 704
    frame #27: 0x32b897c2 WebCore`WebCore::RenderBlock::layout() + 26
    frame #28: 0x32b8974e WebCore`WebCore::RenderView::layout() + 334
    frame #29: 0x32b85cba WebCore`WebCore::FrameView::layout(bool) + 1486
    frame #30: 0x32b82c12 WebCore`WebCore::Document::implicitClose() + 794
    frame #31: 0x32b828f6 WebCore`WebCore::FrameLoader::checkCallImplicitClose() + 86
    frame #32: 0x32b827fe WebCore`WebCore::FrameLoader::checkCompleted() + 134
    frame #33: 0x32b82380 WebCore`WebCore::FrameLoader::finishedParsing() + 64
thread#4:tid=0x3203,0x35dffd7a libicucore.A.dylib`utext\u hasmatadata+546,停止原因=EXC\u BAD\u访问(代码=2,地址=0x0)
帧#0:0x35dffd7a libicucore.A.dylib`utext#u有元数据+546
帧#1:0x003c17d0
帧#2:0x35da6746 libicucore.A.dylib`icu::RuleBasedBreakIterator::handleNext(icu::RBBIStateTable const*)+806
帧#3:0x35da6406 libicucore.A.dylib`icu::RuleBasedBreakIterator::next()+82
帧#4:0x35da5cde libicucore.A.dylib`icu::RuleBasedBreakIterator::following(int)+218
帧#5:0x35db0538 libicucore.A.dylib`ubrk_跟随+8
帧#6:0x32bb0bc8 WebCore`WebCore::textBreakFollowing(WebCore::TextBreakIterator*,int)+8
帧#7:0x32b9baee WebCore`WebCore::nextBreakablePosition(无符号短常量*,int,int,bool)+270
帧#8:0x32bd0dc8 WebCore`WebCore::RenderBlock::findNextLineBreak(WebCore::BidiResolver&,bool,bool&,bool&,bool&,WebCore::EClear*)+6920
帧#9:0x32b8ce02 WebCore`WebCore::RenderBlock::layoutInlineChildren(bool,int&,int&)+1922
帧#10:0x32b8a1ae WebCore`WebCore::RenderBlock::layoutBlock(bool)+690
帧#11:0x32b897c2 WebCore`WebCore::RenderBlock::layout()+26
帧#12:0x32b8b956 WebCore`WebCore::RenderBlock::layoutBlockChild(WebCore::RenderBox*,WebCore::RenderBlock::MarginInfo&,int&,int&)+414
帧#13:0x32b8b24c WebCore`WebCore::RenderBlock::layoutBlockChildren(bool,int&)+428
帧#14:0x32b8a1bc WebCore`WebCore::RenderBlock::layoutBlock(bool)+704
帧#15:0x32b897c2 WebCore`WebCore::RenderBlock::layout()+26
帧#16:0x32b8b956 WebCore`WebCore::RenderBlock::layoutBlockChild(WebCore::RenderBox*,WebCore::RenderBlock::MarginInfo&,int&,int&)+414
帧#17:0x32b8b24c WebCore`WebCore::RenderBlock::layoutBlockChildren(bool,int&)+428
帧#18:0x32b8a1bc WebCore`WebCore::RenderBlock::layoutBlock(bool)+704
帧19:0x32b897c2 WebCore`WebCore::RenderBlock::layout()+26
帧#20:0x32b8b956 WebCore`WebCore::RenderBlock::layoutBlockChild(WebCore::RenderBox*,WebCore::RenderBlock::MarginInfo&,int&,int&)+414
帧#21:0x32b8b24c WebCore`WebCore::RenderBlock::layoutBlockChildren(bool,int&)+428
帧#22:0x32b8a1bc WebCore`WebCore::RenderBlock::layoutBlock(bool)+704
帧23:0x32b897c2 WebCore`WebCore::RenderBlock::layout()+26
帧#24:0x32b8b956 WebCore`WebCore::RenderBlock::layoutBlockChild(WebCore::RenderBox*,WebCore::RenderBlock::MarginInfo&,int&,int&)+414
帧#25:0x32b8b24c WebCore`WebCore::RenderBlock::layoutBlockChildren(bool,int&)+428
帧#26:0x32b8a1bc WebCore`WebCore::RenderBlock::layoutBlock(bool)+704
帧#27:0x32b897c2 WebCore`WebCore::RenderBlock::layout()+26
帧28:0x32b8974e WebCore`WebCore::RenderView::layout()+334
帧#29:0x32b85cba WebCore`WebCore::FrameView::layout(bool)+1486
帧#30:0x32b82c12 WebCore`WebCore::Document::implicitClose()+794
frame#31:0x32b828f6 WebCore`WebCore::FrameLoader::checkCallImplicitClose()+86
帧#32:0x32b827fe WebCore`WebCore::FrameLoader::checkCompleted()+134
帧#33:0x32b82380 WebCore`WebCore::FrameLoader::finishedParsing()+64

更新:具有扩展细节的仪器。仍然没有指向源。它指向机器代码


如果打开“扩展详细信息”视图,则从“详细信息”视图中选择泄漏时,应该能够看到调用堆栈。此外,切换到调用树视图可以帮助您确定代码中发生泄漏的位置。使用跳转栏切换到调用树视图


当您切换到调用树视图时,应该会在调用树的左侧看到一系列复选框。选中“反转调用树”和“隐藏系统库”复选框可以在调用树中查找代码。双击调用树中的一个函数将显示分配泄漏内存的代码行。

谢谢。按照你的指示做了,但仍然没有给我指明正确的方向。更新了问题。屏幕截图中的扩展细节视图显示调用堆栈中的源。如果它只是显示机器代码,那么您将在调用堆栈中获得内存地址,而不是函数名。调用树视图更适合查找代码。如果调用树视图显示的是内存地址而不是函数名,请确保项目正在生成调试符号。