记一次Linux内核崩溃:kdump,crash,vmcore
原理
Linux内核发送崩溃时,kdump会生成一个内核转储文件vmcore。 可以通过分析vmcore分析出内核崩溃的原因。
crash是一个被广泛应用的内核奔溃转储文件分析工具。使用crash调试内核转储文件,需要安装crash工具和内核调试工具kernel-debuginfo。
安装需要的软件
1、查看系统内核
[root@qd01-stop-free015 ~]# uname -r
3.10.0-1160.15.2.el7.x86_64
2、安装kdump,crash
yum install crash kexec-tools -y
3、安装kernel-debuginfo
下载链接http://debuginfo.centos.org/7/x86_64/
rpm -ivh kernel-debuginfo-3.10.0-1160.15.2.el7.x86_64.rpm kernel-debuginfo-common-x86_64-3.10.0-1160.15.2.el7.x86_64.rpm
crash报告分析
1、使用crash命令加载vmcore文件
[root@qd01-stop-free015 kdump]# crash /usr/lib/debug/lib/modules/3.10.0-1160.15.2.el7.x86_64/vmlinux vmcore
crash 7.2.3-11.el7_9.1
Copyright (C) 2002-2017 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 NEC Corporation
Copyright (C) 1999, 2002, 2007 Silicon Graphics, Inc.
Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, 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) 7.6
Copyright (C) 2013 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-unknown-linux-gnu"...
WARNING: kernel relocated [274MB]: patching 87300 gdb minimal_symbol values
KERNEL: /usr/lib/debug/lib/modules/3.10.0-1160.15.2.el7.x86_64/vmlinux
DUMPFILE: vmcore [PARTIAL DUMP]
CPUS: 8
DATE: Thu Mar 4 10:12:38 2021
UPTIME: 00:05:04
LOAD AVERAGE: 5.28, 3.20, 1.38
TASKS: 256
NODENAME: zf-dbslave001
RELEASE: 3.10.0-1160.15.2.el7.x86_64
VERSION: #1 SMP Wed Feb 3 15:06:38 UTC 2021
MACHINE: x86_64 (2500 Mhz)
MEMORY: 63 GB
PANIC: "BUG: unable to handle kernel NULL pointer dereference at 0000000000000074"
PID: 1362
COMMAND: "AliYunDun"
TASK: ffff90f972365280 [THREAD_INFO: ffff90f9767a4000]
CPU: 5
STATE: TASK_RUNNING (PANIC)
输出注释如下:
- KERNEL:系统崩溃时运行的 kernel 文件
- DUMPFILE: 内核转储文件
- CPUS: 所在机器的 CPU 数量
- DATE:系统崩溃的时间
- TASKS:系统崩溃时内存中的任务数
- NODENAME:崩溃的系统主机名
- RELEASE: 和 VERSION:内核版本号
- MACHINE:CPU 架构
- MEMORY:崩溃主机的物理内存
- PANIC:崩溃类型,常见的崩溃类型包括:
- SysRq (System Request):通过魔法组合键导致的系统崩溃,通常是测试使用。通过 echo c > /proc/sysrq-trigger,就可以触发系统崩溃。
- oops:可以看成是内核级的 Segmentation Fault。应用程序如果进行了非法内存访问或执行了非法指令,会得到 Segfault 信号,一般行为是 coredump,应用程序也可以自己截获 Segfault 信号,自行处理。如果内核自己犯了这样的错误,则会弹出 oops 信息。
从以上输出可以知道,本次系统奔溃的原因是:PANIC: "BUG: unable to handle kernel NULL pointer dereference at 0000000000000074"
,然后导致AliYunDun
把系统重启了。
PS:搞不懂阿里云的破逻辑,服务器被黑了居然只会不断重启服务器?
2、使用bt 命令用于查看系统崩溃前的堆栈信息。
crash> bt
PID: 1362 TASK: ffff90f972365280 CPU: 5 COMMAND: "AliYunDun"
#0 [ffff90f9767a77a0] machine_kexec at ffffffff922662c4
#1 [ffff90f9767a7800] __crash_kexec at ffffffff923227a2
#2 [ffff90f9767a78d0] crash_kexec at ffffffff92322890
#3 [ffff90f9767a78e8] oops_end at ffffffff9298c798
#4 [ffff90f9767a7910] no_context at ffffffff92275d14
#5 [ffff90f9767a7960] __bad_area_nosemaphore at ffffffff92275fe2
#6 [ffff90f9767a79b0] bad_area_nosemaphore at ffffffff92276104
#7 [ffff90f9767a79c0] __do_page_fault at ffffffff9298f750
#8 [ffff90f9767a7a30] trace_do_page_fault at ffffffff9298fa26
#9 [ffff90f9767a7a70] do_async_page_fault at ffffffff9298efa2
#10 [ffff90f9767a7a90] async_page_fault at ffffffff9298b7a8
#11 [ffff90f9767a7b98] kmem_cache_alloc_trace at ffffffff92428a0c
#12 [ffff90f9767a7c98] mntput at ffffffff92471d94
#13 [ffff90f9767a7d88] kvm_sched_clock_read at ffffffff9226d3be
#14 [ffff90f9767a7ec8] putname at ffffffff9245fd3d
#15 [ffff90f9767a7f50] system_call_fastpath at ffffffff92994f92
RIP: 00007f84fd928315 RSP: 00007f84fb011af8 RFLAGS: 00000206
RAX: 000000000000004e RBX: 000000000244e010 RCX: ffffffffffffffff
RDX: 0000000000008000 RSI: 000000000244e010 RDI: 0000000000000012
RBP: 000000000244e010 R8: 0000000000000020 R9: 0000000000008030
R10: 0000000000000076 R11: 0000000000000246 R12: ffffffffffffff30
R13: 0000000000000000 R14: 000000000244dfe0 R15: 000000000000052a
ORIG_RAX: 000000000000004e CS: 0033 SS: 002b
3、log 命令可以打印系统消息缓冲区,从而可能找到系统崩溃的线索。输出太多,这里只截取部分信息。
crash> log
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 3.10.0-1160.15.2.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Wed Feb 3 15:06:38 UTC 2021
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-3.10.0-1160.15.2.el7.x86_64 root=UUID=1114fe9e-2309-4580-b183-d778e6d97397 ro crashkernel=auto rhgb quiet LANG=en_US.UTF-8 idle=halt biosdevname=0 net.ifnames=0 console=tty0 console=ttyS0,115200n8 noibrs
[ 0.000000] e820: BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[ 0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x0000000013ffffff] usable
[ 0.000000] BIOS-e820: [mem 0x0000000014000000-0x000000001511ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000015120000-0x00000000bffcdfff] usable
[ 0.000000] BIOS-e820: [mem 0x00000000bffce000-0x00000000bfffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000feffc000-0x00000000feffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000100000000-0x0000000fffffffff] usable
[ 0.000000] BIOS-e820: [mem 0x0000001000000000-0x000000103fffffff] reserved
[ 0.000000] NX (Execute Disable) protection: active
[ 0.000000] SMBIOS 2.8 present.
[ 0.000000] DMI: Alibaba Cloud Alibaba Cloud ECS, BIOS e623647 04/01/2014
[ 0.000000] Hypervisor detected: KVM
[ 0.000000] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
[ 0.000000] e820: remove [mem 0x000a0000-0x000fffff] usable
[ 0.000000] e820: last_pfn = 0x1000000 max_arch_pfn = 0x400000000
[ 0.000000] MTRR default type: write-back
[ 0.000000] MTRR fixed ranges enabled:
[ 0.000000] 00000-9FFFF write-back
[ 0.000000] A0000-BFFFF uncachable
[ 0.000000] C0000-FFFFF write-protect
[ 0.000000] MTRR variable ranges enabled:
[ 0.000000] 0 base 0000C0000000 mask 3FFFC0000000 uncachable
[ 0.000000] 1 disabled
[ 0.000000] 2 disabled
[ 0.000000] 3 disabled
[ 0.000000] 4 disabled
[ 0.000000] 5 disabled
[ 0.000000] 6 disabled
[ 0.000000] 7 disabled
[ 0.000000] PAT configuration [0-7]: WB WC UC- UC WB WP UC- UC
[ 0.000000] e820: last_pfn = 0xbffce max_arch_pfn = 0x400000000
[ 0.000000] found SMP MP-table at [mem 0x000f5a00-0x000f5a0f] mapped at [ffffffffff200a00]
[ 0.000000] Base memory trampoline at [ffff90f800099000] 99000 size 24576
[ 0.000000] Using GB pages for direct mapping
[ 0.000000] BRK [0x70e74000, 0x70e74fff] PGTABLE
[ 0.000000] BRK [0x70e75000, 0x70e75fff] PGTABLE
[ 0.000000] BRK [0x70e76000, 0x70e76fff] PGTABLE
[ 0.000000] BRK [0x70e77000, 0x70e77fff] PGTABLE
[ 0.000000] BRK [0x70e78000, 0x70e78fff] PGTABLE
[ 0.000000] RAMDISK: [mem 0x3625c000-0x37125fff]
[ 0.000000] Early table checksum verification disabled
[ 0.000000] ACPI: RSDP 00000000000f59b0 00014 (v00 BOCHS )
[ 0.000000] ACPI: RSDT 00000000bffe2185 00034 (v01 BOCHS BXPCRSDT 00000001 BXPC 00000001)
[ 0.000000] ACPI: FACP 00000000bffe093e 00074 (v01 BOCHS BXPCFACP 00000001 BXPC 00000001)
[ 0.000000] ACPI: DSDT 00000000bffdfd80 00BBE (v01 BOCHS BXPCDSDT 00000001 BXPC 00000001)
[ 0.000000] ACPI: FACS 00000000bffdfd40 00040
[ 0.000000] ACPI: SSDT 00000000bffe09b2 015FB (v01 BOCHS BXPCSSDT 00000001 BXPC 00000001)
[ 0.000000] ACPI: APIC 00000000bffe1fad 000B0 (v01 BOCHS BXPCAPIC 00000001 BXPC 00000001)
[ 0.000000] ACPI: SRAT 00000000bffe205d 00128 (v01 BOCHS BXPCSRAT 00000001 BXPC 00000001)
[ 4.722250] Adding 33554428k swap on /data/swapfile. Priority:-2 extents:24 across:35823612k FS
[ 5.841211] input: QEMU QEMU USB Tablet as /devices/pci0000:00/0000:00:01.2/usb1/1-1/1-1:1.0/input/input5
[ 5.841325] hid-generic 0003:0627:0001.0001: input,hidraw0: USB HID v0.01 Pointer [QEMU QEMU USB Tablet] on usb-0000:00:01.2-1/input0
[ 13.615575] mzoneinfo: loading out-of-tree module taints kernel.
[ 13.615611] mzoneinfo: module verification failed: signature and/or required key missing - tainting kernel
[ 305.100071] BUG: unable to handle kernel NULL pointer dereference at 0000000000000074
[ 305.101048] IP: [<ffffffffc02d74c0>] 0xffffffffc02d74c0
[ 305.101653] PGD 800000010d7ed067 PUD 176f9c067 PMD 0
[ 305.102276] Oops: 0000 [#1] SMP
[ 305.102675] Modules linked in: tcp_diag inet_diag cirrus ttm nfit drm_kms_helper libnvdimm syscopyarea ppdev sysfillrect intel_powerclamp sysimgblt fb_sys_fops drm iosf_mbi parport_pc crc32_pclmul virtio_balloon parport ghash_clmulni_intel aesni_intel lrw gf128mul drm_panel_orientation_quirks glue_helper pcspkr i2c_piix4 joydev ablk_helper cryptd ip_tables ext4 mbcache jbd2 ata_generic pata_acpi virtio_net virtio_console net_failover virtio_blk failover ata_piix libata crct10dif_pclmul crct10dif_common crc32c_intel virtio_pci virtio_ring floppy serio_raw virtio
[ 305.109021] CPU: 5 PID: 1362 Comm: AliYunDun Kdump: loaded Tainted: G OE ------------ 3.10.0-1160.15.2.el7.x86_64 #1
[ 305.110306] Hardware name: Alibaba Cloud Alibaba Cloud ECS, BIOS e623647 04/01/2014
[ 305.111150] task: ffff90f972365280 ti: ffff90f9767a4000 task.ti: ffff90f9767a4000
[ 305.111977] RIP: 0010:[<ffffffffc02d74c0>] [<ffffffffc02d74c0>] 0xffffffffc02d74c0
[ 305.112843] RSP: 0018:ffff90f9767a7b48 EFLAGS: 00010283
[ 305.113437] RAX: fffffffffffffbd0 RBX: 0000000000000240 RCX: 00000000000007cd
[ 305.114228] RDX: 0000000000000000 RSI: ffff90f972365280 RDI: 00000000ffffffff
[ 305.115014] RBP: ffff90f9767a7b88 R08: 0000000040000000 R09: 0000000000000400
[ 305.115804] R10: 0000000000000000 R11: ffffd9d105c1ea00 R12: 0000000000000240
[ 305.116586] R13: 0000000000000258 R14: 0000000000000018 R15: ffff90f9707aa000
[ 305.117377] FS: 00007f84fb012700(0000) GS:ffff9107ffd40000(0000) knlGS:0000000000000000
[ 305.118276] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 305.118921] CR2: 0000000000000074 CR3: 000000017839e000 CR4: 00000000003606e0
[ 305.119710] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 305.120502] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 305.121291] Call Trace:
[ 305.121581] [<ffffffff92428a0c>] ? kmem_cache_alloc_trace+0x3c/0x200
[ 305.122304] [<ffffffff9242832e>] ? __kmalloc+0x2e/0x230
[ 305.122898] [<ffffffff92471d94>] ? mntput+0x24/0x40
[ 305.123458] [<ffffffff9226d3be>] ? kvm_sched_clock_read+0x1e/0x30
[ 305.124162] [<ffffffff9245fd3d>] ? putname+0x3d/0x60
[ 305.124733] [<ffffffff92994f92>] ? system_call_fastpath+0x25/0x2a
[ 305.125417] Code: 65 48 8b 34 25 c0 0e 01 00 48 8b 96 30 04 00 00 48 8d 82 d0 fb ff ff 48 39 c6 74 2c 3b 7a 74 74 2a b9 d0 07 00 00 eb 0d 0f 1f 00 <3b> 7a 74 74 1b 83 e9 01 74 13 48 8b 90 30 04 00 00 48 8d 82 d0
[ 305.128647] RIP [<ffffffffc02d74c0>] 0xffffffffc02d74c0
[ 305.129263] RSP <ffff90f9767a7b48>
[ 305.129660] CR2: 0000000000000074
4、ps 命令用于显示进程的状态,带 > 标识代表是活跃的进程。
crash> ps
PID PPID CPU TASK ST %MEM VSZ RSS COMM
0 0 0 ffffffff92e18480 RU 0.0 0 0 [swapper/0]
> 0 0 1 ffff90f964f74200 RU 0.0 0 0 [swapper/1]
0 0 2 ffff90f964f75280 RU 0.0 0 0 [swapper/2]
> 0 0 3 ffff90f964f76300 RU 0.0 0 0 [swapper/3]
0 0 4 ffff90f965760000 RU 0.0 0 0 [swapper/4]
0 0 5 ffff90f965761080 RU 0.0 0 0 [swapper/5]
0 0 6 ffff90f965762100 RU 0.0 0 0 [swapper/6]
> 0 0 7 ffff90f965763180 RU 0.0 0 0 [swapper/7]
1 0 3 ffff90f964b60000 IN 0.0 43460 3816 systemd
这里忽略部分信息......
1045 1 6 ffff90f91038c200 IN 0.0 110208 880 agetty
1144 1 3 ffff90f966f6a100 IN 0.0 32544 4304 AliYunDunUpdate
1145 1 3 ffff90f90b3a3180 IN 0.0 32544 4304 AliYunDunUpdate
1146 1 1 ffff90f90b3a2100 IN 0.0 32544 4304 AliYunDunUpdate
1161 1 7 ffff90f978bcb180 IN 0.0 32544 4304 AliYunDunUpdate
1165 1 1 ffff90f910389080 IN 0.0 802872 11300 aliyun-service
1166 1 3 ffff90f978bcc200 IN 0.0 802872 11300 aliyun-service
1170 1 5 ffff90f978bc8000 IN 0.0 802872 11300 aliyun-service
1180 1 3 ffff90f90c3f2100 IN 0.0 802872 11300 aliyun-service
1188 1 5 ffff90f91038d280 IN 0.0 4936 2556 matchpathcond
1191 1 5 ffff90f91038b180 IN 0.0 328 208 postcated
1193 1 7 ffff90f977398000 IN 0.0 3304 184 telinited
1194 1193 5 ffff90f910388000 IN 0.0 3436 1244 telinited
1206 1 0 ffff90f966f68000 IN 0.0 5088 1676 devlinked
1209 1 1 ffff90f970b40000 IN 0.0 172 40 logrotated
1313 1 1 ffff90f90f7d4200 IN 0.0 574284 17500 gmain
1314 1 7 ffff90f90f7d2100 IN 0.0 574284 17500 tuned
1322 1 5 ffff90f9783b8000 IN 0.0 139536 22220 AliYunDun
1323 1 1 ffff90f9533eb180 IN 0.0 139536 22220 AliYunDun
1324 1 5 ffff90f9533ed280 IN 0.0 139536 22220 AliYunDun
1345 1 3 ffff90f91279d280 IN 0.0 574284 17500 tuned
1346 1 5 ffff90f91279e300 IN 0.0 574284 17500 tuned
1347 1 5 ffff90f90eb84200 IN 0.0 718240 7536 rs:main Q:Reg
1349 1 1 ffff90f91279b180 IN 0.0 139536 22220 AliYunDun
1350 1 1 ffff90f91279c200 IN 0.0 139536 22220 AliYunDun
1351 1 1 ffff90f90b3a5280 IN 0.0 139536 22220 AliYunDun
1352 1 4 ffff90f90b3a1080 IN 0.0 139536 22220 AliYunDun
1353 1 5 ffff90f90b3a6300 IN 0.0 139536 22220 AliYunDun
1354 1 5 ffff90f90b3a4200 IN 0.0 139536 22220 AliYunDun
1355 1 1 ffff90f90b3a0000 IN 0.0 139536 22220 AliYunDun
1357 1 7 ffff90f90b780000 IN 0.0 139536 22220 AliYunDun
1358 1 5 ffff90f90b781080 IN 0.0 139536 22220 AliYunDun
1359 1 3 ffff90f972361080 IN 0.0 139536 22220 AliYunDun
1360 1 3 ffff90f972364200 IN 0.0 139536 22220 AliYunDun
1361 1 7 ffff90f972366300 IN 0.0 139536 22220 AliYunDun
> 1362 1 5 ffff90f972365280 RU 0.0 139536 22220 AliYunDun
1363 1 5 ffff90f97b76d280 IN 0.0 139536 22220 AliYunDun
1401 1 3 ffff90f97638d280 IN 0.0 139536 22220 AliYunDun
1402 1 1 ffff90f97638e300 IN 0.0 139536 22220 AliYunDun
1403 1 7 ffff90f97638b180 IN 0.0 139536 22220 AliYunDun
1404 1 7 ffff90f97b76b180 IN 0.0 139536 22220 AliYunDun
1405 1 5 ffff90f97b76c200 IN 0.0 139536 22220 AliYunDun
1406 1 5 ffff90f97b76e300 IN 0.0 139536 22220 AliYunDun
1483 1 5 ffff90f970b45280 IN 0.0 112936 4344 sshd
1570 1483 7 ffff90f90e386300 IN 0.0 157640 6308 sshd
2036 1 1 ffff90f975791080 IN 0.0 802872 11300 aliyun-service
2060 1570 1 ffff90f90c3f4200 IN 0.0 157640 2508 sshd
2066 2060 1 ffff90f90cf8d280 IN 0.0 115548 2084 bash
2963 1 5 ffff90f9767d3180 IN 0.0 328 264 postcated
2973 1 2 ffff90f9767cb180 IN 0.0 5084 1672 devlinked
2977 1 7 ffff90f9767d1080 IN 0.0 172 44 logrotated
3923 2066 7 ffff90f9783be300 IN 0.0 241360 4640 sudo
3924 3923 5 ffff90f975be0000 IN 0.0 191872 2360 su
3925 3924 1 ffff90f90eb86300 IN 0.0 115680 2160 bash
4507 1 1 ffff90f90c3f0000 IN 0.0 17816 2096 assist_daemon
4508 1 7 ffff90f90c3f3180 IN 0.0 17816 2096 Timer thread
4509 1 1 ffff90f90c3f6300 IN 0.0 17816 2096 assist_daemon
4510 1 1 ffff90f90c3f1080 IN 0.0 17816 2096 Timer thread
5820 1 7 ffff90f90eb83180 IN 0.0 328 208 postcated
5824 1 4 ffff90f9767cc200 IN 0.0 5084 1672 devlinked
5828 1 3 ffff90f975b83180 IN 0.0 172 40 logrotated
9989 1 5 ffff90f90df95280 IN 0.0 328 204 postcated
9993 1 6 ffff90f9767b4200 IN 0.0 5088 1676 devlinked
9997 1 3 ffff90f967b7e300 IN 0.0 172 40 logrotated
15502 1 2 ffff90f966f6b180 IN 0.0 328 208 postcated
15528 1 4 ffff90f9533ee300 IN 0.0 5084 1668 devlinked
15532 1 1 ffff90f9533e8000 IN 0.0 172 40 logrotated
22388 1 3 ffff90f90f7c5280 IN 0.0 328 208 postcated
22392 1 4 ffff90f975be3180 IN 0.0 5088 1676 devlinked
22396 1 5 ffff90f977399080 IN 0.0 172 40 logrotated
30647 1 5 ffff90f9767b6300 IN 0.0 328 208 postcated
30651 1 6 ffff90f975b81080 IN 0.0 5092 1676 devlinked
30655 1 5 ffff90f975b85280 IN 0.0 172 40 logrotated
30779 1 3 ffff90f9757b8000 IN 0.0 2442608 3784 mountinfo
30780 1 2 ffff90f975b86300 IN 0.0 2442608 3784 mountinfo
30781 1 4 ffff90f975b82100 IN 0.0 2442608 3784 mountinfo
30783 1 7 ffff90f975b84200 IN 0.0 2442608 3784 mountinfo
30784 1 1 ffff90f90ebc1080 IN 0.0 2442608 3784 mountinfo
30785 1 1 ffff90f8bb941080 IN 0.0 2442608 3784 mountinfo
> 31745 1 0 ffff90f90f7d3180 RU 0.0 2442608 3784 mountinfo
> 31746 1 2 ffff90f90f7d6300 RU 0.0 2442608 3784 mountinfo
> 31747 1 4 ffff90f90f7d0000 RU 0.0 2442608 3784 mountinfo
> 31748 1 6 ffff90f97b76a100 RU 0.0 2442608 3784 mountinfo
从输出看出,mountinfo明显是异常进程,是导致本次系统重启的罪魁祸首
5、这里再次bt 命令来看一下堆栈
crash> bt
PID: 1362 TASK: ffff90f972365280 CPU: 5 COMMAND: "AliYunDun"
#0 [ffff90f9767a77a0] machine_kexec at ffffffff922662c4
#1 [ffff90f9767a7800] __crash_kexec at ffffffff923227a2
#2 [ffff90f9767a78d0] crash_kexec at ffffffff92322890
#3 [ffff90f9767a78e8] oops_end at ffffffff9298c798
#4 [ffff90f9767a7910] no_context at ffffffff92275d14
#5 [ffff90f9767a7960] __bad_area_nosemaphore at ffffffff92275fe2
#6 [ffff90f9767a79b0] bad_area_nosemaphore at ffffffff92276104
#7 [ffff90f9767a79c0] __do_page_fault at ffffffff9298f750
#8 [ffff90f9767a7a30] trace_do_page_fault at ffffffff9298fa26
#9 [ffff90f9767a7a70] do_async_page_fault at ffffffff9298efa2
#10 [ffff90f9767a7a90] async_page_fault at ffffffff9298b7a8
#11 [ffff90f9767a7b98] kmem_cache_alloc_trace at ffffffff92428a0c
#12 [ffff90f9767a7c98] mntput at ffffffff92471d94
#13 [ffff90f9767a7d88] kvm_sched_clock_read at ffffffff9226d3be
#14 [ffff90f9767a7ec8] putname at ffffffff9245fd3d
#15 [ffff90f9767a7f50] system_call_fastpath at ffffffff92994f92
RIP: 00007f84fd928315 RSP: 00007f84fb011af8 RFLAGS: 00000206
RAX: 000000000000004e RBX: 000000000244e010 RCX: ffffffffffffffff
RDX: 0000000000008000 RSI: 000000000244e010 RDI: 0000000000000012
RBP: 000000000244e010 R8: 0000000000000020 R9: 0000000000008030
R10: 0000000000000076 R11: 0000000000000246 R12: ffffffffffffff30
R13: 0000000000000000 R14: 000000000244dfe0 R15: 000000000000052a
ORIG_RAX: 000000000000004e CS: 0033 SS: 002b
我们看到系统崩溃前的最后一个调用是“#15 [ffff90f9767a7f50] system_call_fastpath at ffffffff92994f92
”,现在用 dis 命令来看一下该地址的反汇编结果
6、dis 反编译
crash> dis -l ffffffff92994f92
/usr/src/debug/kernel-3.10.0-1160.15.2.el7/linux-3.10.0-1160.15.2.el7.x86_64/arch/x86/kernel/entry_64.S: 511
0xffffffff92994f92 <system_call_fastpath+37>: mov %rax,0x50(%rsp)
7、查看源码
从上面的反汇编结果中,我们看到问题出在entry_64.S: 第511行代码,翻开源码的相应位置,如下;
492 system_call_fastpath:
493 #if __SYSCALL_MASK == ~0
494 cmpq $__NR_syscall_max+1,%rax
495 #else
496 andl $__SYSCALL_MASK,%eax
497 cmpl $__NR_syscall_max+1,%eax
498 #endif
499 jae badsys
500 ARRAY_INDEX_NOSPEC_SYSCALL clobber_reg=%rcx
501 movq %r10,%rcx
502
503 #ifdef CONFIG_RETPOLINE
504 movq sys_call_table(, %rax, 8), %rax
505 call __x86_indirect_thunk_rax
506 #else
507 call *sys_call_table(, %rax, 8) # XXX: rip relative
508 #endif
509
510 UNWIND_END_OF_STACK
511 movq %rax,RAX(%rsp)
512 /*
记一次Linux内核崩溃:kdump,crash,vmcore的更多相关文章
- linux内核崩溃之kdump机制
kdump相关概念 standard(production) kernel 生产内核 ,是指我们正在使用的kernel. Crash(capture)kernel 捕 ...
- 内核调试工具 — kdump & crash
kdump简介 kdump是系统崩溃的时候,用来转储运行内存的一个工具. 系统一旦崩溃,内核就没法正常工作了,这个时候将由kdump提供一个用于捕获当前运行信息的内核, 该内核会将此时内存中的所有运行 ...
- Linux内核调试:kdump、vmcore、crash、kernel-debuginfo【转】
转自:https://blog.csdn.net/guowenyan001/article/details/19807555 一.简介 linux内核发送崩溃时,kdump会生成一个内核转储文件vmc ...
- linux 内核分析工具 Dtrace、SystemTap、火焰图、crash等
<< System语言详解 >> 关于 SystemTap 的书. 我们在分析各种系统异常和故障的时候,通常会用到 pstack(jstack) /pldd/ lsof/ tc ...
- Linux内核crash/Oops异常定位分析方法
在内核开发的过程中,经常会碰到内核崩溃,比如空指针异常,内存访问越界.通常我们只能靠崩溃之后打印出的异常调用栈信息来定位crash的位置和原因.总结下分析的方法和步骤. 通常oops发生之后,会在串口 ...
- linux内核奇遇记之md源代码解读之四
linux内核奇遇记之md源代码解读之四 转载请注明出处:http://blog.csdn.net/liumangxiong 运行阵列意味着阵列经历从无到有,建立了作为一个raid应有的属性(如同步重 ...
- linux Kernell crash dump------kdump 的安装设置+Linux系统崩溃的修复解决过程+mysql+kvm
http://www.ibm.com/developerworks/cn/linux/l-cn-dumpanalyse/https://www.kernel.org/pub/linux/utils/k ...
- Linux内核Crash分析
转载自:http://linux.cn/article-3475-1.html 在工作中经常会遇到一些内核crash的情况,本文就是根据内核出现crash后的打印信息,对其进行了分析,使用的内核版本为 ...
- 20135316王剑桥Linux内核学习记笔记第七周
20135316王剑桥<Linux内核分析>MOOC课程http://mooc.study.163.com/course/USTC 1000029000 一.可执行程序是怎么得来的? 编译 ...
随机推荐
- zjnu1786 PROSJEK(二分)
Description Sample Input 4 1 1 2 3 4 Sample Output 4.000000 题意:给你n个数,让你找到长度大于等于k的连续串的最大平均值. 思路:我们可以二 ...
- python爬取网易翻译 和MD5加密
一.程序需要知识 1.python中随机数的生成 # 生成 0 ~ 9 之间的随机数 # 导入 random(随机数) 模块 import random print(random.randint(0, ...
- 母函数 <普通母函数(HDU - 1028 ) && 指数型母函数(hdu1521)>
给出我初学时看的文章:母函数(对于初学者的最容易理解的) 普通母函数--------->HDU - 1028 例题:若有1克.2克.3克.4克的砝码各一 枚,能称出哪几种重量?各有几种可能方案? ...
- Codeforces Round #171 (Div. 2) B. Books (模拟队列)
题意:有一组数,问子数组和最大不超过\(t\)的最多元素个数. 题解:用数组模拟队列,不断的往里面放,队列中的元素之和大于\(t\),就不断地从队头弹出直到满足条件,维护一个最大值即可. 代码: in ...
- LINUX - pthread_mutex_lock
原文链接:https://www.cnblogs.com/fengbohello/p/7571722.html 互斥的概念 在多线程编程中,引入了对象互斥锁的概念,来保证共享数据操作的完整性. 每个对 ...
- IOS键盘收起后,页面底部留白处理
环境:vue+vant 的H5页面 场景:输入框输入信息时,如登录.注册等表单信息 问题:键盘收回后页面底部留白,导致dialog组件按钮位移,视觉上,其中的按钮无法正常工作 解决方案:监听失去焦点时 ...
- Linux 驱动框架---i2c驱动框架
i2c驱动在Linux通过一个周的学习后发现i2c总线的驱动框架还是和Linux整体的驱动框架是相同的,思想并不特殊比较复杂的内容如i2c核心的内容都是内核驱动框架实现完成的,今天我们暂时只分析驱动开 ...
- 蓝桥杯——试题 算法训练 Sereja and Squares
Java 代码 ```` import java.util.Scanner; public class Main { private static long num = 0; private stat ...
- Stack Overflow Skill IQ Testing All In One
Stack Overflow Skill IQ Testing All In One Pluralsight IQ | Stack Overflow https://www.pluralsight.c ...
- 在线打开,浏览PDF文件的各种方式及各种pdf插件------(MS OneDrive/google drive & google doc/ github ?raw=true)
在线打开,浏览PDF文件的各种方式: 1 Google drive&doc (国内不好使,you know GFW=Great Firewall) 1. google drive: 直接分 ...