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.

图片 1

相关文章