State-taint analysis for detecting resource bugs

State-taint analysis for detecting resource bugs
复制标题

用于检测资源错误的状态污点分析

DOI:
10.1016/j.scico.2017.06.010
复制
发表时间:
2018
影响因子:
1.3
通讯作者:
Qin Shengchao
Qin Shengchao
中科院分区:
计算机科学4区
文献类型:
--
作者:
Xu Zhiwu;Wen Cheng;Qin Shengchao

文献摘要

相似文献

确保程序以适当的方式使用其资源对程序的正确性至关重要。已经提出了许多解决方案来检查程序在资源使用方面是否满足这样的属性。但是,在实践中,它们中的许多都非常复杂,无法用于资源错误检测,并且没有考虑到一旦打开或需要资源就应该使用它的期望。这种开放但不使用的问题在某些情况下可能会导致资源饥饿,例如,智能手机或其他移动设备,其中资源不仅稀缺,而且耗能,因此不适当的资源使用不仅会导致系统耗尽资源,还会导致电池充电之间的电池寿命大大缩短。这就是所谓的能量泄漏问题。在本文中,我们提出了一种称为状态污染分析的静态分析来检测资源错误。考虑到开放但未使用的问题,我们根据资源协议指定资源的适当使用。然后,我们提出了一种类似污染的分析方法,该方法使用资源协议来指导资源错误检测。作为一种扩展和应用,我们将可能导致能量泄漏的不适当行为丰富到协议中,并使用改进后的协议来指导对能量泄漏检测的分析。我们将分析作为一个名为statedoid的原型工具来实现。使用这个工具,我们在几个真实的Android应用程序上进行了实验,并测试了来自Relda和GreenDroid的数据集。实验结果表明,该方法准确、实用,能够检测出更多的能量泄漏模式。
To ensure that a program uses its resources in an appropriate manner is vital for program correctness. A number of solutions have been proposed to check that programs meet such a property on resource usage. But many of them are sophisticated to use for resource bug detection in practice and do not take into account the expectation that a resource should be used once it is opened or required. Thisopen-but-not-usedproblem can cause resource starvation in some cases, for example, smartphones or other mobile devices where resources are not only scarce but also energy-hungry, hence inappropriate resource usage can not only cause the system to run out of resources but also lead to much shorter battery life between battery recharge. That is the so-callenergy leakproblem.In this paper, we propose a static analysis calledstate-taint analysisto detect resource bugs. Taking theopen-but-not-usedproblem into account, we specify the appropriate usage of resources in terms of resource protocols. We then propose a taint-like analysis which employs resource protocols to guide resource bug detection. As an extension and an application, we enrich the protocols with the inappropriate behaviours that may cause energy leaks, and use the refined protocols to guide the analysis for energy leak detection. We implement the analysis as a prototype tool calledstatedroid. Using this tool, we conduct experiments on several real Android applications and test datasets from Relda and GreenDroid. The experimental results show that our tool is precise, helpful and suitable in practice, and can detect more energy leak patterns.