Skip to main content
QUICK REVIEW

[论文解读] FReD: Automated Debugging via Binary Search through a Process Lifetime

Kapil Arya, Tyler Denniston|arXiv (Cornell University)|Dec 20, 2012
Parallel Computing and Optimization Techniques参考文献 31被引用 4
一句话总结

FReD 通过程序执行生命周期中的自动化二分查找技术,定位复杂多线程应用程序中难以发现的、非时间局部性错误的根本原因。通过利用检查点机制、基于自定义 DMTCP 插件的确定性重放,以及与 GDB 的集成,FReD 实现了反向表达式监视点,能够高效缩小程序不变量从正确变为违反的精确源代码语句范围,从而在 16 核系统上实现 29 至 406 秒的调试时间。

ABSTRACT

Reversible debuggers have been developed at least since 1970. Such a feature is useful when the cause of a bug is close in time to the bug manifestation. When the cause is far back in time, one resorts to setting appropriate breakpoints in the debugger and beginning a new debugging session. For these cases when the cause of a bug is far in time from its manifestation, bug diagnosis requires a series of debugging sessions with which to narrow down the cause of the bug. For such "difficult" bugs, this work presents an automated tool to search through the process lifetime and locate the cause. As an example, the bug could be related to a program invariant failing. A binary search through the process lifetime suffices, since the invariant expression is true at the beginning of the program execution, and false when the bug is encountered. An algorithm for such a binary search is presented within the FReD (Fast Reversible Debugger) software. It is based on the ability to checkpoint, restart and deterministically replay the multiple processes of a debugging session. It is based on GDB (a debugger), DMTCP (for checkpoint-restart), and a custom deterministic record-replay plugin for DMTCP. FReD supports complex, real-world multithreaded programs, such as MySQL and Firefox. Further, the binary search is robust. It operates on multi-threaded programs, and takes advantage of multi-core architectures during replay.

研究动机与目标

  • 解决诊断‘困难’错误的挑战,这些错误缺乏良好的时间局部性,其根本原因与错误表现相距甚远。
  • 自动化缩小此类错误根本原因的过程,而无需手动反向逐条执行数百万条指令。
  • 在可扩展且高效的调试环境中,支持复杂的真实世界多线程程序(如 MySQL 和 Firefox)。
  • 通过自动化二分查找,支持高级别的、基于表达式的调试查询(例如:'这个不变量在何时变为假?')。
  • 与现有工具(GDB、DMTCP)集成,同时通过添加确定性记录-重放和反向执行功能扩展其能力。

提出的方法

  • FReD 使用 DMTCP 实现检查点-重启,并通过自定义的确定性记录-重放插件记录系统调用、pthread 调用和 glibc 库调用,以保证执行的确定性。
  • 它将 GDB 作为前端调试器,并与之集成,以支持反向执行和表达式求值。
  • 其核心技术是在程序执行时间线上进行二分查找,由用户定义的、从真变为假的表达式引导。
  • 在每一步中,系统进行检查点,向前重放至中点,并检查目标表达式是否仍为真,从而将搜索空间缩小一半。
  • 该算法可精确定位导致表达式变为假的源代码语句,避免依赖手动设置断点或逐步反向执行。
  • 通过在确定性重放过程中利用并行性,支持多核重放,显著提升了现代多核架构上的性能。

实验结果

研究问题

  • RQ1能否通过在进程生命周期内进行自动化二分查找,高效定位复杂多线程程序中非时间局部性错误的根本原因?
  • RQ2如何有效结合确定性重放与检查点机制,与符号化调试器协同,实现可扩展的反向调试?
  • RQ3与手动反向逐条执行相比,反向表达式监视点在真实应用程序中能在多大程度上缩短调试时间?
  • RQ4该方法能否在保持正确性和性能的前提下,扩展到生产级高度并发的系统(如 MySQL 和 Firefox)?
  • RQ5在可逆调试环境中,维持确定性重放并启用二分查找的性能开销有多大?

主要发现

  • FReD 成功利用自动化二分查找,在复杂多线程程序(如 MySQL 和 Firefox)中定位了错误的根本原因。
  • 该系统在 16 核机器上实现的调试时间范围为 29 至 406 秒,证明了其在真实世界调试中的实际性能。
  • 反向表达式监视点功能可精确定位导致程序不变量失效的语句,而无需手动反向执行。
  • 与未经修改的 GDB 和 DMTCP 集成,确保了兼容性和可扩展性,同时在多种工作负载下保持了鲁棒性。
  • 在重放过程中利用多核架构,实现了快速的确定性重放,使二分查找具备可扩展性和高效性。
  • 该方法优于手动反向调试,消除了在大型执行轨迹上反复使用反向下一步或反向步进命令的需求。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。