我正在测试一个EXE_BAD_ACCESS错误。我已经将NSZombieEnabled,MallocStackLogging,MallocStackLoggingNoCompact设置为YES。现在在调试器中,当我在调试模式下从设备运行我的应用程序时,我会看到这样的消息:
iota(3586) malloc: recording malloc stacks to disk using standard recorder
iota(3586) malloc: stack logs being written into /private/var/mobile/Applications/8E21A85B-369E-4487-962B-1550E56602DC/tmp/stack-logs.3586.iota.index
iota(3586) malloc: Please issue: cp /private/var/mobile/Applications/8E21A85B-369E-4487-962B-1550E56602DC/tmp/stack-logs.3586.iota.suRQjy.link /tmp/当我遇到错误的时候,
2011-02-14 14:29:44.350 iota[3586:307] *** -[CFString autorelease]: message sent to deallocated instance 0x81eab70最后,当我在debugger中给出命令来查看堆栈跟踪时
(gdb)外壳malloc_history 3586 0x81eab70
我得到了
malloc_history cannot examine process 3586 because the process does not exist.谁能告诉我我做错了什么,在错误发生之前,我设置了
set env MallocStackLogging 1 in the debugger too提前感谢
发布于 2011-02-14 17:42:02
据我所知,您正在手动释放已在自动释放池中的字符串。
使用创建的所有字符串
[NSString stringWithFormat:@"some %@", @"text"];和
[NSString stringWithString:@"some text"];不得手动释放。
发布于 2011-08-12 02:44:41
您可能无法查看malloc_history,因为您正在设备上运行此程序。我遇到了同样的错误,Instruments也冻结或没有启动我的应用程序。
但是-如果我在iOS模拟器中运行,然后配置分配工具来处理僵尸(这个选项在设备上不可用),那么我可以很快看到过早释放的对象。
https://stackoverflow.com/questions/4990601
复制相似问题