一句话:提出七类执行器管理误用分类与资源管理模型,并实现静态分析工具 PoolGuard 检测 Java 线程池误用。
异步编程是现代软件性能的基础,Java 中基于 ExecutorService 的执行器已成为管理并发任务的标准抽象。已有研究广泛关注传统并发缺陷,但对执行器管理误用分析不足:这类缺陷并非源于异步任务的业务逻辑,而是源于执行器的配置、使用与终止方式。本文提出七类执行器管理误用模式的分类体系,并用资源管理模型对其进行形式化。基于该模型,作者实现静态分析框架 PoolGuard,既能检测执行器通用的生命周期与结果处理缺陷,也能检测 ThreadPoolExecutor 特有的配置误用。在包含真实缺陷的基准套件上的评估表明,PoolGuard 优于专用异步检测器以及 SpotBugs、Infer 等通用分析器。将该工具应用于大规模开源系统,共发现 50 个此前未知的问题,其中 24 个已被开发者修复或确认,体现了语义分析在检测执行器管理缺陷方面的实用价值。
Asynchronous programming is fundamental to modern software performance, and Java ExecutorService-based executors have become a standard abstraction for managing concurrent tasks. While existing research has extensively studied traditional concurrency bugs, management misuses of executors remain under-analyzed. These defects arise not from the business logic of asynchronous tasks, but from how executors are configured, used, and terminated. We present a taxonomy of seven executor-management misuse patterns and formalize them using a resource-management model. Based on this, we develop PoolGuard, a static analysis framework for detecting both executor-generic lifecycle/result-handling defects and ThreadPoolExecutor-specific configuration misuses. Extensive evaluation on a benchmark suite with real-world defects shows that PoolGuard is better than specialized async detectors as well as general-purpose analyzers such as SpotBugs and Infer. Applying PoolGuard to large-scale open-source systems, we identified 50 previously unknown issues, 24 of which have already been fixed or confirmed by developers, demonstrating the practical value of semantic analysis for executor-management defects.
@inproceedings{paperbot12540,
title = {From Thread to Pool: Modeling and Static Detection of Thread Pool Misuses in Java Programs},
author = {Baoquan Cui and Yucheng Qiu and Rui Han and Hang Gao and Jian Zhang},
booktitle = {ASE},
year = {2026},
doi = {10.1145/3832783.3837508}
}