• 分析kdump(vmcore)


    1.环境

    1. [root@localhost ~]# cat /etc/redhat-release
    2. CentOS Linux release 7.9.2009 (Core)
    3. [root@localhost ~]# uname -a
    4. Linux localhost.localdomain 3.10.0-1160.62.1.el7.x86_64 #1 SMP Tue Apr 5 16:57:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

    2.分下kdump文件需要安装crash与kernel-debuginfo

    1. yum -y install crash
    2. yum --enablerepo=base-debuginfo install -y kernel-debuginfo-$(uname -r)

    3.启动

    crash /opt/127.0.0.1-2022-07-24-13_22_33/vmcore /usr/lib/debug/lib/modules/3.10.0-1160.62.1.el7.x86_64/vmlinux

    启动失败,由于调试机器的内核版本与产生coredump的机器的内核版本不一致,导致crash启动失败,根据vmcore-dmesg.txt文件可知内核版本2.6.32-431.el6.x86_64,根据https://en.wikipedia.org/wiki/CentOS找到centos6.5对应的内核版本就是2.6.32-431.el6.x86_64

    4.安装虚拟机

    通过虚拟机装centos6.5 下载镜像https://vault.centos.org/6.5/isos/x86_64/CentOS-6.5-x86_64-bin-DVD1.iso 安装完虚拟机之后,更新yum报错

    1. [root@localhost ]# yum update
    2. ...repomd.xml: [Errno 14] problem making ssl connection
    3. Essai d'un autre miroir.
    4. Erreur : Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again"

    以上错误 

    Fixing yum repos on CentOS 6 now it’s EOL – Mark Gilbert's Tech Blog

    解决方案更新/etc/yum.repos.d/CentOS-Base.repo内容

    1. [C6.10-base]
    2. name=CentOS-6.10 - Base
    3. baseurl=http://linuxsoft.cern.ch/centos-vault/6.10/os/$basearch/
    4. gpgcheck=1
    5. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
    6. enabled=1
    7. metadata_expire=never
    8. [C6.10-updates]
    9. name=CentOS-6.10 - Updates
    10. baseurl=http://linuxsoft.cern.ch/centos-vault/6.10/updates/$basearch/
    11. gpgcheck=1
    12. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
    13. enabled=1
    14. metadata_expire=never
    15. [C6.10-extras]
    16. name=CentOS-6.10 - Extras
    17. baseurl=http://linuxsoft.cern.ch/centos-vault/6.10/extras/$basearch/
    18. gpgcheck=1
    19. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
    20. enabled=1
    21. metadata_expire=never
    22. [C6.10-contrib]
    23. name=CentOS-6.10 - Contrib
    24. baseurl=http://linuxsoft.cern.ch/centos-vault/6.10/contrib/$basearch/
    25. gpgcheck=1
    26. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
    27. enabled=0
    28. metadata_expire=never
    29. [C6.10-centosplus]
    30. name=CentOS-6.10 - CentOSPlus
    31. baseurl=http://linuxsoft.cern.ch/centos-vault/6.10/centosplus/$basearch/
    32. gpgcheck=1
    33. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
    34. enabled=0
    35. metadata_expire=never

    5.centos6.5安装kernel-debuginfo

    下载kernel-debuginfo

    1. wget http://debuginfo.centos.org/6/x86_64/kernel-debuginfo-2.6.32-431.el6.x86_64.rpm
    2. wget http://debuginfo.centos.org/6/x86_64/kernel-debuginfo-common-x86_64-2.6.32-431.el6.x86_64.rpm

    安装kernel-debuginfo

    1. #先安装
    2. rpm -ivh kernel-debuginfo-common-x86_64-2.6.32-431.el6.x86_64.rpm
    3. #再安装
    4. rpm -ivh kernel-debuginfo-2.6.32-431.el6.x86_64.rpm

    6.启动crash

    1. [root@localhost debuginfo]# crash ./vmcore /usr/lib/debug/lib/modules/2.6.32-431.el6.x86_64/vmlinux
    2. crash 7.1.0-8.el6
    3. Copyright (C) 2002-2014 Red Hat, Inc.
    4. Copyright (C) 2004, 2005, 2006, 2010 IBM Corporation
    5. Copyright (C) 1999-2006 Hewlett-Packard Co
    6. Copyright (C) 2005, 2006, 2011, 2012 Fujitsu Limited
    7. Copyright (C) 2006, 2007 VA Linux Systems Japan K.K.
    8. Copyright (C) 2005, 2011 NEC Corporation
    9. Copyright (C) 1999, 2002, 2007 Silicon Graphics, Inc.
    10. Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc.
    11. This program is free software, covered by the GNU General Public License,
    12. and you are welcome to change it and/or distribute copies of it under
    13. certain conditions. Enter "help copying" to see the conditions.
    14. This program has absolutely no warranty. Enter "help warranty" for details.
    15. GNU gdb (GDB) 7.6
    16. Copyright (C) 2013 Free Software Foundation, Inc.
    17. License GPLv3+: GNU GPL version 3 or later
    18. This is free software: you are free to change and redistribute it.
    19. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
    20. and "show warranty" for details.
    21. This GDB was configured as "x86_64-unknown-linux-gnu"...
    22. please wait... (gathering task table data)
    23. crash: invalid task address: ffff880631fdb500
    24. crash: invalid task address: ffff88022fcaaae0
    25. crash: invalid task address: ffff8803d2f0d540
    26. crash: invalid task address: ffff8804ddefe040
    27. KERNEL: /usr/lib/debug/lib/modules/2.6.32-431.el6.x86_64/vmlinux
    28. DUMPFILE: ./vmcore [PARTIAL DUMP]
    29. CPUS: 8
    30. DATE: Sat Jul 23 22:22:31 2022
    31. UPTIME: 442 days, 20:23:48
    32. LOAD AVERAGE: 1.12, 1.16, 1.11
    33. TASKS: 1241
    34. NODENAME: dzswj-hlw-fpzx-ap08
    35. RELEASE: 2.6.32-431.el6.x86_64
    36. VERSION: #1 SMP Fri Nov 22 03:15:09 UTC 2013
    37. MACHINE: x86_64 (2100 Mhz)
    38. MEMORY: 28 GB
    39. PANIC: "general protection fault: 0000 [#1] SMP "
    40. PID: 9415
    41. COMMAND: "tomcatName.sh"
    42. TASK: ffff8802d075caa0 [THREAD_INFO: ffff880514d0e000]
    43. CPU: 6
    44. STATE: TASK_RUNNING (PANIC)
    45. crash>

    备注

    调试机器的内核版本要与产生coredump的机器的内核版本一致。 

    参考

    Analyzing the Core Dump - CentOS - Linux

    CentOS 7 - How to install kernel-debuginfo · GitHub

    How to use kdump for Linux Kernel Crash Analysis

    Bug hunting — The Linux Kernel documentation

  • 相关阅读:
    微软独家付费功能,也被完美解锁了
    三菱PLC单轴运动控制
    Zabbix技术分享——如何使用zabbix监控华为云RDS
    山西电力市场日前价格预测【2023-10-28】
    河南资信评价资质申报日期一览
    【机器学习】实验2布置:基于回归分析的大学综合得分预测
    机器学习3判断机器算法的性能
    【C++进阶之路】第十一篇:C++的IO流
    Java判断时间间隔来决定任务执行
    pve关闭windows虚拟机慢
  • 原文地址:https://blog.csdn.net/MEIYOUDAO_JIUSHIDAO/article/details/126494447