我的 CentOS 6.8 服务器每隔几天就会崩溃,我试图找出原因。我正在使用内核版本 2.6.32-642.1.1.el6.x86_64。到目前为止,我已经安装了程序 crash,以帮助我筛选因内核恐慌而创建的内核转储。但老实说,我不太理解它输出的很多信息。
[root@resh boot]# crash /usr/lib/debug/lib/modules/2.6.32-642.1.1.el6.x86_64/vmlinux /var/crash/127.0.0.1-2016-08-02-09\:12\:20/vmcore
KERNEL: /usr/lib/debug/lib/modules/2.6.32-642.1.1.el6.x86_64/vmlinux
DUMPFILE: /var/crash/127.0.0.1-2016-08-02-09:12:20/vmcore [PARTIAL DUMP]
CPUS: 32
DATE: Tue Aug 2 09:09:29 2016
UPTIME: 12:47:24
LOAD AVERAGE: 4.78, 4.66, 4.55
TASKS: 998
NODENAME: resh.cluster.org
RELEASE: 2.6.32-642.1.1.el6.x86_64
VERSION: #1 SMP Tue May 31 21:57:07 UTC 2016
MACHINE: x86_64 (2294 Mhz)
MEMORY: 31.8 GB
PANIC: "BUG: unable to handle kernel NULL pointer dereference at 0000000000000002"
PID: 42993
COMMAND: "kslowd002"
TASK: ffff88040d88d520 [THREAD_INFO: ffff880100000000]
CPU: 7
STATE: TASK_RUNNING (PANIC)
崩溃回溯:
crash> bt
PID: 42993 TASK: ffff88040d88d520 CPU: 7 COMMAND: "kslowd002"
#0 [ffff8801000039c0] machine_kexec at ffffffff8103fdcb
#1 [ffff880100003a20] crash_kexec at ffffffff810d1fe2
#2 [ffff880100003af0] oops_end at ffffffff8154bd00
#3 [ffff880100003b20] no_context at ffffffff810518cb
#4 [ffff880100003b70] __bad_area_nosemaphore at ffffffff81051b55
#5 [ffff880100003bc0] bad_area_nosemaphore at ffffffff81051c23
#6 [ffff880100003bd0] __do_page_fault at ffffffff8105231c
#7 [ffff880100003cf0] do_page_fault at ffffffff8154dc8e
#8 [ffff880100003d20] page_fault at ffffffff8154af95
[exception RIP: unknown or invalid address]
RIP: 0000000000000002 RSP: ffff880100003dd8 RFLAGS: 00010202
RAX: ffffffffa0465a80 RBX: ffff8801bc7da200 RCX: ffff8801bc7da2a8
RDX: 0000000000000002 RSI: 00000000ffffffff RDI: ffff8801bc7da200
RBP: ffff880100003e20 R8: ffffffff81ad12d8 R9: fe2582cc8764a601
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: ffff8801bc7da248 R14: ffff8801bc7da290 R15: 00000000ffffffff
ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018
#9 [ffff880100003dd8] fscache_object_slow_work_execute at ffffffffa0460e9f [fscache]
#10 [ffff880100003e28] slow_work_execute at ffffffff81121363
#11 [ffff880100003e68] slow_work_thread at ffffffff81121645
#12 [ffff880100003ee8] kthread at ffffffff810a662e
#13 [ffff880100003f48] kernel_thread at ffffffff8100c28a
崩溃日志:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000002
IP: [<0000000000000002>] 0x2
PGD 0
Oops: 0010 [#1] SMP
last sysfs file: /sys/devices/system/cpu/online
CPU 7
Modules linked in: nfs nfsd lockd nfs_acl auth_rpcgss sunrpc 8021q garp stp llc cpufreq_ondemand freq_table pcc_cpufreq cachefiles fscache(T) ipv6 ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack iptable_filter ip_tables xfs exportfs ext2 power_meter acpi_ipmi ipmi_si ipmi_msghandler microcode iTCO_wdt iTCO_vendor_support hpilo hpwdt igb i2c_algo_bit i2c_core ptp pps_core sg serio_raw lpc_ich mfd_core ioatdma dca shpchp ext4 jbd2 mbcache sd_mod crc_t10dif hpsa ahci dm_mirror dm_region_hash dm_log dm_mod [last unloaded: scsi_wait_scan]
Pid: 42993, comm: kslowd002 Tainted: G -- ------------ T 2.6.32-642.1.1.el6.x86_64 #1 HP ProLiant DL360e Gen8
RIP: 0010:[<0000000000000002>] [<0000000000000002>] 0x2
RSP: 0018:ffff880100003dd8 EFLAGS: 00010202
RAX: ffffffffa0465a80 RBX: ffff8801bc7da200 RCX: ffff8801bc7da2a8
RDX: 0000000000000002 RSI: 00000000ffffffff RDI: ffff8801bc7da200
RBP: ffff880100003e20 R08: ffffffff81ad12d8 R09: fe2582cc8764a601
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: ffff8801bc7da248 R14: ffff8801bc7da290 R15: 00000000ffffffff
FS: 0000000000000000(0000) GS:ffff8800380e0000(0000) knlGS:0000000000000000
CS: 0010 DS: 0018 ES: 0018 CR0: 000000008005003b
CR2: 0000000000000002 CR3: 0000000001a8d000 CR4: 00000000000407e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process kslowd002 (pid: 42993, threadinfo ffff880100000000, task ffff88040d88d520)
Stack:
ffffffffa0460e9f ffff880100003e00 ffff8801bc7da238 ffff8801bc7da298
<d> 0000000000000002 ffffffff81f55ec0 ffff8801bc7da290 ffff8801bc7da298
<d> 0000000000000001 ffff880100003e60 ffffffff81121363 ffff880100003e60
Call Trace:
[<ffffffffa0460e9f>] ? fscache_object_slow_work_execute+0xaf/0x1c0 [fscache]
[<ffffffff81121363>] slow_work_execute+0x233/0x310
[<ffffffff81121645>] slow_work_thread+0x205/0x360
[<ffffffff810a6ac0>] ? autoremove_wake_function+0x0/0x40
[<ffffffff81121440>] ? slow_work_thread+0x0/0x360
[<ffffffff810a662e>] kthread+0x9e/0xc0
[<ffffffff8100c28a>] child_rip+0xa/0x20
[<ffffffff810a6590>] ? kthread+0x0/0xc0
[<ffffffff8100c280>] ? child_rip+0x0/0x20
Code: Bad RIP value.
RIP [<0000000000000002>] 0x2
RSP <ffff880100003dd8>
CR2: 0000000000000002
有谁明白是什么导致了它崩溃?如果有任何程序可以帮助诊断问题,我愿意听取他们的意见。
答案1
快速回答:
这看起来与内核错误 #13998(请参阅下面我是如何得出这个结论的),该结论在后来的内核版本中尚未重现。如果是这种情况,请升级到较新的内核(或较新版本的 CentOS,相同的差异),应该解决与模块相关的问题fscache
。
fscache
问题的线索:
PANIC: "BUG: unable to handle kernel NULL pointer dereference at 000000000000002"
意味着内核试图加载一个没有意义的内存地址。
COMMAND: "kslowd002"
这是内核在发生恐慌时尝试运行的命令。这并不一定意味着这是导致崩溃的命令,但这是一个很好的起点。什么是kslowd
?仔细阅读一下这里。
在回溯中:
#9 [ffff880100003dd8] fscache_object_slow_work_execute at ffffffffa0460e9f [fscache]
是之前运行的最后一个过程:
[exception RIP: unknown or invalid address]
这是内核无法取消引用的 NULL 指针,换句话说,内核试图在内存中查找但无法查找的位置,因为它不存在。这是一个已知的错误fscache
,显然已在更高版本的内核版本中得到解决。
这里是针对未解决的同一问题的 CentOS-6 特定错误报告 (#0007782)。 CentOS 的建议还包括确保内核是最新的可用版本,在您的情况下,这可能需要升级到 CentOS 的下一个稳定主要版本。
有关阅读这些故障转储的更多信息,我强烈推荐本教程: http://www.dedoimedo.com/computers/crash-analyze.html