歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux kernel panic解決方法

Linux kernel panic解決方法

日期:2017/2/28 15:57:47   编辑:Linux教程

kernel panic錯誤表現

kernel panic 主要有以下幾個出錯提示:
Kernel panic-not syncing fatal exception in interrupt
kernel panic - not syncing: Attempted to kill the idle task!
kernel panic - not syncing: killing interrupt handler!
Kernel Panic - not syncing:Attempted to kill init !

kernel錯誤分析

查看了一下 linux的源碼文件,找到相關位置
kernel/panic.c
NORET_TYPE void panic(const char * fmt, ...)
{
static char buf[1024];
va_list args;
bust_spinlocks(1);
va_start(args, fmt);
vsnprintf(buf, sizeof(buf), fmt, args);
va_end(args);
printk(KERN_EMERG "Kernel panic - not syncing: %s/n",buf);
bust_spinlocks(0);

kernel/exit.c

if (unlikely(in_interrupt()))
panic("Aiee, killing interrupt handler!"); #中斷處理
if (unlikely(!tsk->pid))
panic("Attempted to kill the idle task!"); #空任務
if (unlikely(tsk->pid == 1))
panic("Attempted to kill init!"); #初始化


從其他源文件和相關文檔看到應該有幾種原因:

1、硬件問題
使用了 SCSI-device 並且使用了未知命令

#WDIOS_TEMPPANIC Kernel panic on temperature trip
#
# The SETOPTIONS call can be used to enable and disable the card
# and to ask the driver to call panic if the system overheats.
#
# If one uses a SCSI-device of unsupported type/commands, one
# immediately runs into a kernel-panic caused by Command Error. To better
# understand which SCSI-command caused the problem, I extended this
# specific panic-message slightly.
#
#read/write causes a command error from
# the subsystem and this causes kernel-panic

2、系統過熱
如果系統過熱會調用panci,系統掛起

#WDIOS_TEMPPANIC Kernel panic on temperature trip
#
# The SETOPTIONS call can be used to enable and disable the card
# and to ask the driver to call panic if the system overheats.

3、文件系統引起

#A variety of panics and hangs with /tmp on a reiserfs filesystem
#Any other panic, hang, or strange behavior
#
# It turns out that there's a limit of six environment variables on the
# kernel command line. When that limit is reached or exceeded, argument
# processing stops, which means that the 'root=' argument that UML
# usually adds is not seen. So, the filesystem has no idea what the
# root device is, so it panics.
# The fix is to put less stuff on the command line. Glomming all your
# setup variables into one is probably the best way to go.

Copyright © Linux教程網 All Rights Reserved