Archive for April, 2010

Linus 调试内核的方法

在水母上看到有人给出的链接。原文比较长,简单说,就是有人发现 Linux 2.6.34-rc3 有一个 bug,大家 de 不掉,最后被 Linus 亲自 de 掉了,他使用的方法是用眼睛看。

it was primarily looking at the source and thinking about what was happening.

In the process three other bugs were found and fixed, and the section of code got significant documentation and cleanup improvements.

Linus was unable to reliably replicate the bug, so printf, kgdb, etc could not be used.

大意:

主要是一边看源代码一边想是怎么回事。

在修复这个 bug 的过程中,又发现并修复了其他三个 bug,同时这部分代码的注释和清晰程度也有了显著的提升。

Linus 没法可靠地重现问题,所以 printf、kgdb 等东西都没法用。

总之,别说 Linus 只是运气好,刚好赶上了很多人想在 386 上跑免费 UNIX 的那个时机推出了自己的操作系统。机遇只偏爱有准备的人。

标签:

贴图一张

虽然我是中国人,我如果不看中文,实在没办法搞懂这句中式英语想告诉我什么东西。

在国内公共设施上见到、听到的英语,除去涉外场所(机场、海关等),我觉得北京地铁用得最好,大概是托 2008 的福吧。第一次听到地铁报站正确地读出母校的英文名的时候好感动……

标签: , ,