我的操作系统是Debian,当gdb用来分析一个核心转储文件时,得到以下信息:
......
Program terminated with signal SIGSEGV, Segmentation fault.
warning: Unexpected size of section `.reg-xstate/67327' in core file.
.....
Run Code Online (Sandbox Code Playgroud)
谁能解释为什么提示警告(“ Unexpected size of section '.reg-xstate/67327' in core file.”)?
PS,我的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".
Run Code Online (Sandbox Code Playgroud)
小智 7
我知道这篇文章相当旧,但我刚刚点击了这篇文章,这篇文章是谷歌的最佳结果。
虽然核心转储有可能被截断,但这不太可能,因为.reg-xstate核心转储的部分存储在文件的最开头附近。导致该问题的一个更可能的原因是正在使用的 GDB 版本不支持已添加到 XSAVE 区域(又名 xstate)的较新处理器功能。
由于我使用与 OP 相同版本的 GDB (7.12),我猜测它们也在 Skylake 或更新的 CPU 上运行。Skylake CPU 可以支持内存保护密钥,作为其中的一部分,名为 PKRU 的新寄存器被添加到 XSAVE 区域。GDB 8 添加了对这个新寄存器的支持。