arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1207.2544cs.PL
收藏

多线程程序系统测试中的变量和线程绑定

Variable and Thread Bounding for Systematic Testing of Multithreaded Programs

Sandeep Bindal, Sorav Bansal, Akash Lal

摘要:

以前的方法,系统的状态空间探索测试多线程程序提出了上下文绑定和深度绑定是有效的排名算法测试多线程程序。本文提出了两个新的指标来排名线程调度系统的状态空间探索。我们的指标基于使用v(表现错误所需的不同变量的最小数量)和t(表现错误所需的调度约束的不同线程的最小数量)对并发错误的描述。我们的算法是基于这样的假设,即在实践中,大多数并发错误具有低v(通常为1 - 2)和低t(通常为2 - 4)的特性。我们以v和t的递增顺序迭代地探索调度的搜索空间。我们定性和经验表明,我们的算法发现常见的错误,在较少的执行运行次数,与以前的方法相比。我们还表明,使用v和t提高了通过随机算法发现错误的概率的下限。系统地探索时间表需要对程序进行的每个变量访问进行检测,这可能非常昂贵,并且严重限制了这种方法的适用性。以前的工作[5,19]通过只在同步操作上插入(并忽略其他变量访问)来避免这个问题。我们证明,通过使用变量绑定(v)和静态不精确的别名分析,我们可以在所有变量访问(而不仅仅是同步操作)上进行同步,开销比以前的方法少10 - 100倍。

英文摘要:

Previous approaches to systematic state-space exploration for testing multi-threaded programs have proposed context-bounding and depth-bounding to be effective ranking algorithms for testing multithreaded programs. This paper proposes two new metrics to rank thread schedules for systematic state-space exploration. Our metrics are based on characterization of a concurrency bug using v (the minimum number of distinct variables that need to be involved for the bug to manifest) and t (the minimum number of distinct threads among which scheduling constraints are required to manifest the bug). Our algorithm is based on the hypothesis that in practice, most concurrency bugs have low v (typically 1- 2) and low t (typically 2-4) characteristics. We iteratively explore the search space of schedules in increasing orders of v and t. We show qualitatively and empirically that our algorithm finds common bugs in fewer number of execution runs, compared with previous approaches. We also show that using v and t improves the lower bounds on the probability of finding bugs through randomized algorithms. Systematic exploration of schedules requires instrumenting each variable access made by a program, which can be very expensive and severely limits the applicability of this approach. Previous work [5, 19] has avoided this problem by interposing only on synchronization operations (and ignoring other variable accesses). We demonstrate that by using variable bounding (v) and a static imprecise alias analysis, we can interpose on all variable accesses (and not just synchronization operations) at 10-100x less overhead than previous approaches.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑