期刊文献+

面向顺序存储结构的数据流分析 被引量:5

Data Flow Analysis for Sequential Storage Structures
下载PDF
导出
摘要 C程序中数组、malloc动态分配后的连续内存等顺序存储结构被大量使用,但大多数传统的数据流分析方法未能充分描述其结构及其上的操作,特别是在利用指针访问顺序存储结构时,传统的分析方法只关注了指针的指向关系,而未讨论指针可能发生偏移的数值信息,且未考虑发生偏移时可能存在越界的不安全问题,导致了对顺序存储结构分析不精确.针对以上不足,首先对顺序存储结构进行抽象建模,并对顺序存储结构与指针结合使用时的指向关系与偏移量进行有效表示,建立了用于顺序存储结构的抽象内存模型SeqMM;其次,归纳总结C程序中顺序存储结构涉及的指针相关迁移操作、谓词操作及遍历顺序存储结构的循环操作,提出了安全范围判别保证操作安全性;之后,针对函数调用时形参指针引用顺序存储结构与实参的映射过程进行过程间推导规则设计;最后,基于上述分析,提出了一种内存泄漏缺陷检测算法,对5个开源C工程的内存泄漏缺陷进行检测.实验结果表明,所提出的Seq MM能够有效地刻画C程序中的顺序存储结构及其涉及的各种操作,其数据流分析结果能够用于内存泄漏的检测工作,同时在效率和精度之间取得合理的权衡. Sequential storage structures such as array and continuous memory block allocated dynamically by malloc are widely used in C programs. But traditional data flow analysis fails to adequately describe their structures and operations. When pointers are used to access the sequential storage structures in C programs, existing data flow analysis methods basically pay attention to only points-to information and do not consider the numerical properties offset. In addition, it does not consider the unsafe problem caused by out of bounds when offset occurs, which leads to inaccurate analysis for sequential storage structure. To improve the precision for analyzing sequential storage structures, an abstract memory model SeqMM is proposed to describe sequential storage structures, which can effectively describe points-to relationships and offset. Then there are three operations are summarized, such as the pointer-related transfer operation, predicate operation, and loop operation traversing sequential storage structures, and it is also considered that whether the index is out of bounds to ensure the security of operation execution when analyzing these operations. After that, mapping rules are introduced for parameters referencing sequential storage structure to corresponding arguments. Finally, a memory leak detection algorithm is proposed to detect memory leak in 5 open-source projects. The experimental results indicate that SeqMM can effectively describe sequential storage structure and various operations in C programs, and the results of data flow analysis can be used to detect memory leaks when a reasonable balance between accuracy and efficiency occurs.
作者 王淑栋 尹文静 董玉坤 张莉 刘浩 WANG Shu-Dong;YIN Wen-Jing;DONG Yu-Kun;ZHANG Li;LIU Hao(College of Computer Science and Technology,China University of Petroleum,Qingdao 266580,China)
出处 《软件学报》 EI CSCD 北大核心 2020年第5期1276-1293,共18页 Journal of Software
基金 中央高校基本科研业务费专项资金(19CX02028A) 国家自然科学基金(61873281)。
关键词 顺序存储结构 数据流分析 抽象内存模型 过程间分析 内存泄漏 sequential storage structure data flow analysis abstract memory model inter-prcedural analysis memory leak
  • 相关文献

参考文献6

二级参考文献47

  • 1Ball T, Bounimova E, Cook B, et al. Thorough static analysis of device drivers [ C ]//2006 EuroSys Conference. New York: Association for Computing Machinery, 2006 : 73-85.
  • 2Yang Junfeng, Sar Can, Engler Dawson. Explode: a lightweight, general system for finding serious storage system errors[C]//Tth USENIX Symposium on Operating Systems Design and Implementation. [ S. l. ]: USENIX ASSOC, 2006: 131-146.
  • 3Engler D, Chelf B, Chou A, et al. Checking system rules using system-specific, programmer-written compiler extensions [C]//Proceedings of the 4th Conference on Symposium on Operating System Design & Implementation. [S.l. ] : USENIX Association, 2000: 1-16.
  • 4Ashcraft K, Engler D. Using programmer-written compiler extensions to catch security holes[C]//2002 Symposium on Security and Privacy. [S. l. ] : Institute of Electrical and Electronics Engineers Inc, 2002: 143-159.
  • 5Hovemeyer D, Pugh W. Finding bugs is easy[J]. ACM SIGPLAN Notices, 2004, 39(12) : 92-106.
  • 6Hovemeyer D, Pugh W. Finding more null pointer hugs, but not too many[C]//Proceedings of the 7th ACM SIGPLAN-SlGSOFT Workshop on Program Analysis for Software Tools and Engineering. New York: ACM Press, 2007: 9-14.
  • 7Klocwork Inc. Klocwork trail version [ EB/OL]. [ S. l. ] : Klocwork Inc. 2008. http://www, kiocwork, com/freetrial.
  • 8Chou A,Yang J, Chelf B, et al. An empirical study of operating systems errors[C]//Proceedings of the Eighteenth ACM Sym- posium on Operation Systems Priciples. New York, NY, USA: ACM,2001:73- 88.
  • 9Hasting R,Joyce B. Purify: Fast detection of memory leaks and access errors[C]//Proceedings of the Winter USENIX Conf1 rence. San Francisco, USA ~ Winter, 19 9 2 :12 5-13 6.
  • 10Havelund K, Rosu G. Monitoring Java programs with Java Pa- thExplorer[C] // Proceedings of the 1st Workshop on Runtime Verification. Paris, France, 2001.

共引文献37

同被引文献30

引证文献5

二级引证文献3

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部