了解 macOS 的分段错误错误

发布于 2025-01-13 15:42:33 字数 723 浏览 2 评论 0原文

运行我的应用程序时,我收到分段错误,然后弹出一个窗口让我知道:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0x0000000128108eb3 WP_ForcePowerRun(gentity_s*, forcePowers_t, usercmd_s*) + 4435
0x0000000128107c15 WP_ForcePowersUpdate(gentity_s*, usercmd_s*) + 501
0x0000000128033bc1 ClientThink_real(gentity_s*, usercmd_s*) + 1153
0x0000000128035843 ClientThink(int, usercmd_s*) + 995
0x00000001280bf68a NPC_Think(gentity_s*) + 1786
0x000000012805ef4a G_RunFrame(int) + 1418
0x000000010d28b4d0 SV_Frame(int, float) + 576
0x000000010d266c4c Com_Frame() + 588
0x000000010d2d7525 main + 389
0x00007fff2046af3d start + 1

所以我有两个问题:

  1. 每个函数右侧的数字是什么,即 +4435、+501 等?
  2. 有什么方法可以确定发生分段错误的具体行号吗?

When running my application, I receive a segmentation fault then a window pops up letting me know that:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0x0000000128108eb3 WP_ForcePowerRun(gentity_s*, forcePowers_t, usercmd_s*) + 4435
0x0000000128107c15 WP_ForcePowersUpdate(gentity_s*, usercmd_s*) + 501
0x0000000128033bc1 ClientThink_real(gentity_s*, usercmd_s*) + 1153
0x0000000128035843 ClientThink(int, usercmd_s*) + 995
0x00000001280bf68a NPC_Think(gentity_s*) + 1786
0x000000012805ef4a G_RunFrame(int) + 1418
0x000000010d28b4d0 SV_Frame(int, float) + 576
0x000000010d266c4c Com_Frame() + 588
0x000000010d2d7525 main + 389
0x00007fff2046af3d start + 1

So I have two questions:

  1. What are the numbers on the right side of each function i.e +4435, +501, etc.?
  2. Is there any way to determine the specific line number where the segmentation fault is happening?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萌︼了一个春 2025-01-20 15:42:33
  1. 这些是偏移量,也就是在函数开始后发生错误的字节数。

  2. 您可以使用调试符号进行编译并使用 GDB 等调试器。

  1. Those are the offset, aka how many bytes after the beginning of the function the fault happened.

  2. You can compile with debug symbols and use a debugger like GDB.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文