简体   繁体   English

使用性能工具,分配在Iphone上调试EXEC_BAD_ACCESS

[英]Debugging the EXEC_BAD_ACCESS on Iphone using Performance Tool, Allocations

An error is caught, using Zombie CFString Foundation Library 使用Zombie CFString Foundation Library捕获了错误
caller {NSPlaceholderMutableString int] Malloc 呼叫者{NSPlaceholderMutableString int] Malloc

CFString Foundation Library CFString基础库
caller {NSPlaceholderString initWithFormat:locale} Zombie 呼叫者{NSPlaceholderString initWithFormat:locale}僵尸

well it didn't drop to where I declared. 好吧,它并没有降到我声明的位置。 I have no idea where that NSMutablestring is called and which variable it is 我不知道在哪里调用NSMutablestring以及它是哪个变量

  • Instruments provides an option to record reference counts -- ensure it's enabled. 仪器提供了记录参考计数的选项-确保已启用。
  • Run your app and reproduce the issue. 运行您的应用并重现问题。
  • When Instruments halts the program due to messaging a zombie, it will tell you the address of the zombie. 当仪器由于发送僵尸消息而暂停程序时,它将告诉您僵尸的地址。
  • You then locate the address in the list of allocations and view the location it was created, as well as all its ref count ops. 然后,您可以在分配列表中找到该地址,并查看其创建位置以及所有引用计数操作。

It takes about 2 minutes to spot an issue once you get the hang of it, and can reproduce the problem. 抓住问题的根源,大约需要2分钟才能发现问题,并且可以重现该问题。 Good luck. 祝好运。

Also, 0x8badf00d has recommended "session 311 Advanced Memory analysis with Instruments." 此外,0x8badf00d还建议使用“使用仪器进行的会话311高级内存分析”。 below. 下面。 I've not watched it personally, but it sounds like it would be a great session on the subject. 我没有亲自观看过,但是听起来这将是一个很棒的话题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM