Linus 调试内核的方法
由 chys 发表于 2010 年 04 月 26 日在水母上看到有人给出的链接。原文比较长,简单说,就是有人发现 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 的那个时机推出了自己的操作系统。机遇只偏爱有准备的人。
标签: misc
