AddressWatcher:基于消毒器的内存泄漏修复定位
AddressWatcher: Sanitizer-Based Localization of Memory Leak Fixes
AI总结:
本文提出动态框架 AddressWatcher,通过泄漏数据库在多条执行路径上追踪内存对象语义以定位内存泄漏修复点,并在多个开源项目中验证其有效性。
摘要:
内存泄漏缺陷是 C/C++ 程序中的一个主要问题。当内存对象未被释放时就会发生内存泄漏。开发者需要手动释放这些对象以防止内存泄漏。因此,已有多种技术被提出用于自动修复内存泄漏。尽管所提出的方法在自动修复内存泄漏方面具有一定价值,但它们存在局限性。基于静态分析的方法试图在所有路径上追踪内存对象的完整语义。然而,当目标程序存在大量泄漏路径时,它们面临可扩展性方面的挑战。另一方面,动态分析方法只能在单条执行路径上阐明内存对象的精确语义(而不考虑多条执行路径)。在本文中,我们通过设计并实现一个名为 AddressWatcher 的新型框架来补充先前的方法。AddressWatcher 作为一种动态方法,允许在多条执行路径上追踪内存对象的语义。AddressWatcher 通过使用一个泄漏数据库来实现这一点,该数据库被设计为能够在多个测试用例上存储和比较同一泄漏的不同执行路径。我们在由五个开源软件包(即 binutils、openssh、tmux、openssl 和 git)组成的基准上对 AddressWatcher 进行了评估。在 50 个被检查的内存泄漏缺陷中,有 23 个 AddressWatcher 正确指向了用于修复内存泄漏的释放位置。此外,我们向 12 个流行的开源项目仓库提交了 25 个新的拉取请求(PR)。这些 PR 旨在解决这些仓库中的内存泄漏问题。其中,21 个 PR 被合并,解决了 5 个开放的 GitHub issue。事实上,一个关键修复促使 calc 仓库发布了一个新版本,calc 是一个用于查找大素数的程序。此外,我们通过这些 PR 所做的贡献在 coturn、h2o 和 radare2 等多个仓库中引发了热烈的讨论和赞赏。
英文摘要:
Memory leak bugs are a major problem in C/C++ programs. They occur when memory objects are not deallocated.Developers need to manually deallocate these objects to prevent memory leaks. As such, several techniques have been proposed to automatically fix memory leaks. Although proposed approaches have merit in automatically fixing memory leaks, they present limitations. Static-based approaches attempt to trace the complete semantics of memory object across all paths. However, they have scalability-related challenges when the target program has a large number of leaked paths. On the other hand, dynamic approaches can spell out precise semantics of memory object only on a single execution path (not considering multiple execution paths). In this paper, we complement prior approaches by designing and implementing a novel framework named AddressWatcher. AddressWatcher allows the semantics of a memory object to be tracked on multiple execution paths as a dynamic approach. Addresswatcher accomplishes this by using a leak database that is designed to allow storing and comparing different execution paths of a leak over several test cases. We conduct an evaluation of AddressWatcher on a benchmark of five open-source packages, namely binutils, openssh, tmux, openssl and git. In 23 out of the 50 examined memory leak bugs, AddressWatcher correctly points to a free location to fix memory leaks. Moreover, we submitted 25 new pull requests (PRs) to 12 popular open-source project repositories. These PRs targeted the resolution of memory leaks within these repositories. Among these, 21 PRs were merged, addressing 5 open GitHub issues. In fact, a critical fix prompted a new version release for the calc repository, a program used to find large primes. Furthermore, our contributions through these PRs sparked intense discussions and appreciation in various repositories such as coturn, h2o, and radare2.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。