在 MacOSX/PPC 上,有关如何在 0x0000000000000000 捕获 KERN_PROTECTION_FAILURE 的建议
这是一个实时 MMO 客户端,在某个随机点它会崩溃并跳转到 0,并且堆栈帧不可读。 崩溃报告器(和 GDB)将报告线程 0 崩溃:
XC_BAD_ACCESS (SIGBUS)
KERN_PROTECTION_FAILURE at 0x0000000000000000
以及
srr0=lr=exception address=0
如何捕获此错误发生的位置?
This is a real time MMO client, at some random point it will crash with a jump to 0, and the stack frame is unreadable. The crash reporter (and GDB) will report thread 0 crashed:
XC_BAD_ACCESS (SIGBUS)
KERN_PROTECTION_FAILURE at 0x0000000000000000
and
srr0=lr=exception address=0
How can I catch where this error occurs?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果你的堆栈指针(
r1
)和链接寄存器被丢弃,那么它看起来就不太好。 然而,其他一些寄存器可能仍然具有帧指针的值 - 例如,经常看到非叶函数将地址移动到它们通过 r0 返回到堆栈或从堆栈返回的地址。除此之外,您还可以使用一些技巧 - 假设在地址
0x0
处的进程地址空间中没有任何映射(这似乎是EXEC_BAD_ACCESS
的情况) > 错误)您可以编写一个映射零页的简单预加载库; 这将允许您在0x0
处添加断点; 这可能会为您提供有关正在发生的事情的更多信息。If your stack pointer (
r1
) and link register are trashed then it's not looking good. However, it's possible that some other registers may still have the value of a frame pointer in them - for example non-leaf functions often seen to move the address to they return to to/from the stack viar0
.Other than that there's a couple of tricks you could pull - assuming that there is nothing mapped in the processes' address space at address
0x0
(which appears to be the case from theEXEC_BAD_ACCESS
error) you could write a simple preload library which mapped page zero; which would allow you to add a breakpoint at0x0
; which may give you more info on what's going on.