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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值