c - 为什么 gdb 会抛出内部错误并告诉我有错误?
问题描述
我正在尝试调试一个简单的程序,但 gdb 正在运行。我得到内部错误,然后 gdb 说有一个错误。当我尝试停止正在运行的程序时会发生这种情况。发送键盘中断返回调试器后,我尝试使用quit
. 但是当我这样做时,我得到了这个(我还包括当我完成问题时会发生什么):
A debugging session is active.
Inferior 1 [process 1239] will be killed.
Quit anyway? (y or n) y
../../gdb/target.c:2149: internal-error: void target_mourn_inferior(ptid_t): Assertion `ptid == inferior_ptid' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) y
This is a bug, please report it. For instructions, see:
<https://www.gnu.org/software/gdb/bugs/>.
../../gdb/target.c:2149: internal-error: void target_mourn_inferior(ptid_t): Assertion `ptid == inferior_ptid' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) y
Abort trap: 6 (core dumped)
有人可以告诉我发生了什么,为什么会发生,以及如何解决它吗?
解决方案
有人能告诉我发生了什么吗
GDB 已经告诉过你:
This is a bug, please report it. For instructions, see: <https://www.gnu.org/software/gdb/bugs/>.
如果一个程序曾经报告它本身有一个错误,那么它总是正确的。即使它认为的行为实际上不是错误的,那么程序也是错误的。
在这种特殊情况下,GDB 在自己的代码中报告断言失败。这绝对是一个实现错误,而不是错误报告错误。
为什么会这样
它可能是由正在调试的程序的一些不寻常的事情触发的——这本身可能是错误的——但这并不能使它成为 GDB 错误。
以及如何解决它?
您不太可能自己修复 gdb 错误,但可能存在您可以升级到的更新版本,其中错误已得到修复。
推荐阅读
- c# - 检测 DateTimePicker 中的时间变化
- flutter - 如何将数据从一个类传递到另一个类?
- reactjs - 在 NavigationOptions 中调用 setstate 反应原生
- docker - 为什么插值键“asctime”不是有效的选项名称?
- asp.net-mvc - ckfinder 浏览服务器在 https 上不起作用
- angular - 从Angular中的分离组件转移价值
- c++ - Winsock2:select() 函数给出“无效的争论错误”(错误 10022)?
- npm - 由于权限错误,无法使用 npm 安装 appium
- node.js - 通过存储客户端将文件发送到存储桶中的文件夹
- angular - 如何使管道始终工作,而不是检查更改?