有没有办法知道哪个对象收到了objc_release消息?

时间:2017-02-25 01:49:50

标签: objective-c macos memory-management exc-bad-access

使用EXC_BAD_ACCESS崩溃,堆栈符号如下所示:

po [NSThread callStackSymbols]
<_NSCallStackArray 0x608000052c60>(
0   ???                                 0x00000001077e66cd 0x0 + 4420691661,
1   Flume-Debug                         0x000000010003ee60 main + 0,
2   libobjc.A.dylib                     0x00007fffdbde90fc _ZN12_GLOBAL__N_119AutoreleasePoolPage11tls_deallocEPv + 110,
3   libsystem_pthread.dylib             0x00007fffdc8eb50f _pthread_tsd_cleanup + 544,
4   libsystem_pthread.dylib             0x00007fffdc8eb249 _pthread_exit + 152,
5   libsystem_pthread.dylib             0x00007fffdc8e9ab6 pthread_sigmask + 0,
6   libsystem_pthread.dylib             0x00007fffdc8e99f7 _pthread_body + 0,
7   libsystem_pthread.dylib             0x00007fffdc8e91fd thread_start + 13
)

我的平台ix x86_64,所以我tried examining注册$rdi$rsi没有太多运气:

po [(id)$rdi class]
error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=1, address=0x40dedeadbec8).
The process has been returned to the state before expression evaluation.

这甚至可能吗?由于收件人的地址不正确,邮件已经被发送并导致崩溃。启用NSZombie无效 - 代码崩溃在同一点没有其他有用信息。

查看和回溯,我应该问自己 - “哪个对象已添加到自动释放池但是手动/早期解除分配?”找出问题所在?

0 个答案:

没有答案