崩溃:结构无效 成员偏移量:kmem_cache_s_num 文件:memory.c 行:9619 函数:kmem_cache_init()

crash: invalid structure member offset: kmem_cache_s_num FILE: memory.c LINE: 9619 FUNCTION: kmem_cache_init()

提问人:NobinPegasus 提问时间:5/10/2023 更新时间:5/14/2023 访问量:196

问:

我正在学习linux内核开发。对它很陌生。我正在玩内核恐慌。

我的操作系统版本:

pegasus@pegasusv:~$ uname -a
Linux pegasusv 5.19.0-41-generic #42-Ubuntu SMP PREEMPT_DYNAMIC Mon Apr 17 19:17:03 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

我在 QEMU/KVM 上。 我运行的命令导致恐慌:

echo c > /proc/sysrq-trigger

在运行它之前,我已经正确配置了所有内容。 我正在点击这个链接: 我还下载了同一内核的所有 dbg-sym 映像。

https://ruffell.nz/programming/writeups/2019/02/22/beginning-kernel-crash-debugging-on-ubuntu-18-10.html

但是当我使用相同的内核重新启动并运行崩溃时,我收到以下错误:

pegasus@pegasusv:/usr/lib/debug/boot$ crash vmlinux-5.19.0-41-generic /var/crash/202305100142/dump.202305100142 

crash 8.0.0
Copyright (C) 2002-2021  Red Hat, Inc.
Copyright (C) 2004, 2005, 2006, 2010  IBM Corporation
Copyright (C) 1999-2006  Hewlett-Packard Co
Copyright (C) 2005, 2006, 2011, 2012  Fujitsu Limited
Copyright (C) 2006, 2007  VA Linux Systems Japan K.K.
Copyright (C) 2005, 2011, 2020-2021  NEC Corporation
Copyright (C) 1999, 2002, 2007  Silicon Graphics, Inc.
Copyright (C) 1999, 2000, 2001, 2002  Mission Critical Linux, Inc.
Copyright (C) 2015, 2021  VMware, Inc.
This program is free software, covered by the GNU General Public License,
and you are welcome to change it and/or distribute copies of it under
certain conditions.  Enter "help copying" to see the conditions.
This program has absolutely no warranty.  Enter "help warranty" for details.
 
GNU gdb (GDB) 10.2                             
Copyright (C) 2021 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-pc-linux-gnu".
Type "show configuration" for configuration details.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...

please wait... (gathering kmem slab cache data)
crash: invalid structure member offset: kmem_cache_s_num
       FILE: memory.c  LINE: 9619  FUNCTION: kmem_cache_init()

[/usr/bin/crash] error trace: 56207d0cb69e => 56207d09f2f4 => 56207d16d11b => 56207d16d09c

如何解决?

Linux 内核 崩溃转储 恐慌

评论


答:

0赞 Frank Hoeflich 5/14/2023 #1

已在此错误报告中的上游修复的已知问题。我在 4.0-2.12 发行说明下的 crash-utility 的 github 更新日志中找到了您的kmem_cache_s_num错误消息。您只需要找到在 Ubuntu 环境中使用此 crash(8) 更新的最佳方式;您可以在 github 存储库中找到 Ubuntu 打包的二进制文件,也可以从 github 存储库中的源代码构建。

祝您修复和持续开发好运!

评论

0赞 roolebo 9/20/2023
Canonical 没有撞到崩溃实用程序,尽管他们将 Ubuntu 内核提升到 6.2:bugs.launchpad.net/ubuntu/+source/crash/+bug/2012060