Linux kernel panic解决方法
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.