menu

秋梦无痕

一场秋雨无梦痕,春夜清风冻煞人。冬来冷水寒似铁,夏至京北蟑满城。

Avatar

panic("Dizzily Headache.");

天气阴沉沉的,似乎要下雪了。
骑车到公司,跟帅哥美女们打招呼,都感叹好久没有见到我了。
打开电脑,开OE,收邮件,开qq,msn,开一个IE看blog,开一个IE访问Google,开两个VC,各打开一个工程。
头开始疼了,刺痛的感觉。
跟美女同事讨论需求,头还是疼。
修改msn签名为panic("Dizzily Headache.");
头还是疼。
跟同事讨论头疼的问题,同事说已经头疼很久了,一直靠药物。
Fenbid Ibuprofen Sustained Release Capsules, 0.3 g 。。。
胃开始有灼烧的感觉。
尖锐的刺痛感觉开始模糊。
胃似乎失去感觉。
钝化的痛感。
反胃,有点想吐。
发现两个边界错误。
让测试程序跑着,吃饭去。
城隍庙,炒面很难吃,灌汤小笼都没汤,西红柿鸡蛋汤好喝。
绿灯在我走到马路中间的时候变成了红灯,只好站在车水马龙的知春路中间,继续抽世纪红塔。
程序over,发现一个边界错误。
头疼得好点了。
继续测试。

附注:
csh说没有找到比panic后果更严重的函数,呵呵,其实内核里面有不少的。看unix system V源代码的时候,对panic印象最深而已。

/*
* linux/kernel/panic.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
*/

/*
* This function is used through-out the kernel (including mm and fs)
* to indicate a major problem.
*/

...

/**
* panic - halt the system
* @fmt: The text string to print
*
* Display a message, then perform cleanups.
*
* This function never returns.
*/

NORET_TYPE void panic(const char * fmt, ...)
{
long i;
static char buf[1024];
va_list args;
#if defined(CONFIG_ARCH_S390)
unsigned long caller = (unsigned long) __builtin_return_address(0);
#endif

/*
* It's possible to come here directly from a panic-assertion and not
* have preempt disabled. Some functions called from here want
* preempt to be disabled. No point enabling it later though...
*/
preempt_disable();

/*
* 吴雨注:纪录出错原因。
*/
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);

/*
* If we have crashed and we have a crash kernel loaded let it handle
* everything else.
* Do we want to call this before we try to display a message?
*/
crash_kexec(NULL);

#ifdef CONFIG_SMP
/*
* Note smp_send_stop is the usual smp shutdown function, which
* unfortunately means it may not be hardened to work in a panic
* situation.
*/
smp_send_stop();
#endif
/*
* 吴雨注:纪录调用堆栈。指明那些调用涉及此次Panic。
*/
notifier_call_chain(&panic_notifier_list, 0, buf);

/*
* 吴雨注:重新起动系统。不过,内核应该sync文件系统缓存并向dumpdevice写内存数据的,没看到在哪个函数里面操作。
*/
if (!panic_blink)
panic_blink = no_blink;

if (panic_timeout > 0) {
/*
* Delay timeout seconds before rebooting the machine.
* We can't use the "normal" timers since we just panicked..
*/
printk(KERN_EMERG "Rebooting in %d seconds..",panic_timeout);
for (i = 0; i < panic_timeout*1000; ) {
touch_nmi_watchdog();
i += panic_blink(i);
mdelay(1);
i++;
}
/*
* Should we run the reboot notifier. For the moment Im
* choosing not too. It might crash, be corrupt or do
* more harm than good for other reasons.
*/
machine_restart(NULL);
}
#ifdef __sparc__
{
extern int stop_a_enabled;
/* Make sure the user can actually press Stop-A (L1-A) */
stop_a_enabled = 1;
printk(KERN_EMERG "Press Stop-A (L1-A) to return to the boot prom\n");
}
#endif
#if defined(CONFIG_ARCH_S390)
disabled_wait(caller);
#endif
local_irq_enable();
for (i = 0;;) {
i += panic_blink(i);
mdelay(1);
i++;
}
}

//cmft...
U'll get well soon...
gg/gl

//cmft...
U'll get well soon...
gg/gl

注意健康呀,老弟。

昨天我明明留言了,怎么不见了?

我也没看到哦

评论已关闭