Windows DLL幽灵崩溃的根因追踪
推荐指数 47.0 NO. 013 · 2026.06.29
发布2026/06/28Score104Comments37
为什么值得看
微软工程师追踪到第三方程序崩溃源于已卸载DLL残留内存导致的栈溢出。这种底层调试案例对理解Windows异常分发机制和DLL生命周期边界极有价值。
编辑判断
这个案例的精妙之处在于崩溃现场完全指向ntdll的异常分发例程,真正的凶手DLL早已从模块列表消失。调试者通过分析chkstk的调用上下文和栈上的残留返回地址,反推出RtlLookupFunctionEntry在遍历已卸载DLL的 unwind info 时陷入无限递归。
这类幽灵DLL问题在注入框架、热更新系统和安全软件中并不罕见,但极少有公开的高质量调试记录。如果你在做Windows平台的稳定性工程或逆向分析,这篇的排查思路比任何文档都实用:当崩溃栈看起来"太干净"、只停留在系统DLL时,要怀疑模块卸载时序和异常分发路径的交叉污染。
社区反馈
正面 34 条评论
核心争论:对底层调试技术的敬佩与对'heisenbug'定义严谨性的短暂争论
相关内容
That's some doggedly determined back tracing to uncover an unexpected heisenbug (loose meaning). So a total of 46% of the crashes were due to this rogue force-unload of a DLL. This is a case of bucket spray, where a single underlying cause generates a large number of different types of crashes.
We've not yet seen sufficient evidence this is any type of heisenbug.
Looking more closely would resolve it one way or the other.