linux - 为什么gdb在core文件中提示 "Unexpected size of section ` .reg-xstate/xxxxx'?

标签 linux gdb debian

我的操作系统是Debian,使用gdb分析一个core dump文件,得到如下信息:

......
Program terminated with signal SIGSEGV, Segmentation fault.

warning: Unexpected size of section `.reg-xstate/67327' in core file.
.....

谁能解释为什么会提示警告(“Unexpected size of section '.reg-xstate/67327' in core file.”)?

附言,我的 gdb 版本是:

$ gdb
GNU gdb (Debian 7.12-6+b1) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".

最佳答案

我知道这篇文章很旧,但我只是点击了这篇文章,这篇文章是谷歌搜索结果中的热门。

虽然核心转储有可能被截断,但这不太可能,因为核心转储的 .reg-xstate 部分存储在文件的最开头附近。问题的一个更可能的原因是正在使用的 GDB 版本不理解已添加到 XSAVE 区域(又名 xstate)的较新处理器功能。

因为我使用的是与 OP 相同版本的 GDB (7.12),所以我猜测它们也在 Skylake 或更新的 CPU 上运行。 Skylake CPU 可以支持称为内存保护 key 的东西,作为其中的一部分,一个名为 PKRU 的新寄存器被添加到 XSAVE 区域。 GDB 8 中添加了对这个新寄存器的支持。

关于linux - 为什么gdb在core文件中提示 "Unexpected size of section ` .reg-xstate/xxxxx'?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47047779/

相关文章:

linux - 对Linux感到困惑

linux - 从具有父目录的每个子文件夹复制特定文件

python - Windows 无法正确读取 .py 文件

linux - 在 linux shell 中进行 ascii 移动

python - 使用 cron 追加现有的 sqlite3 数据库

c - Linux 内核函数 memblock_alloc_range_nid 未出现在地址空间中

c - 检索 PID 时 pclose 随机出现段错误

linux - 特殊 cron 表达式 : how to make an exception?

c++11 - 使用 gdb 调试 C++11 右值引用

python - 由于权限问题,django-chronograph 脚本不会从 cron 作业运行或手动运行