Computer Science ›› 2019, Vol. 46 ›› Issue (11A): 517-523.

• Interdiscipline & Application • Previous Articles     Next Articles

Source Code Memory Leak Static Detection Based on Complex Control Flow

JI Xiu-juan1, SUN Xiao-hui2, XU Jing3   

  1. (Binhai College,Nankai University,Tainjin 300270,China)1;
    (Jingdong Digital Technology,Beijing 100176,China)2;
    (College of Artificial Intelligence,Nankai University,Tianjin 300350,China)3
  • Online:2019-11-10 Published:2019-11-20

Abstract: C/C++ source code has a lot of memory leaks because of its manual allocation of heap memory space.Regarding complex control flow with multiple branches in the control flow graph,it is more difficult to detect memory leaks because of the uncertainty of memory allocating and releasing.A memory leak classification method was defined based on path abstraction in complex control flow.A projection-based model detection based on the analysis algorithm was proposed,where the original control flow graph is projected,thus simplifying and regulating the control flow graph.Meanwhile,in the inter-procedural analysis,by combining Cloning Expands the ICFG approach and Expanded Super-graph approach,a Inter-procedural Memory def-use Control Flow Graph(IMCFG) was built.At last,this algorithm is proved to be effective and precise by experiments.

Key words: Memory leak, Complex control flow, Projection, Static detection, C/C++

CLC Number: 

  • TP311
[1]United States Computer Emergency Readiness Team(US-CERT)[OL].https://www.us-cert.gov/ 2016,7,5
[2]cmm5定义bug等级[OL].http://www.docin.com/p-1535244861.html.
[3]LEAK M.[OL].http://www.baike.com/wiki/%E5%86%85%E5%AD %98%E6%B3%84%E6%BC%8F.
[4]王喆.C/C++代码内存泄漏缺陷检测方法研究[D].大连:大连理工大学,2012.
[5]LI M C,CHEN Y J,WANG L Z,et al.Dynamically validating static memory leak warnings[C]∥International Symposium on Software Testing and Analysis Conference.Lugano,Switzerland,2013:112-122
[6]LEE S H,JUNG C H,RAMAN E,et al.Automated memory leak detection for production use[C]∥International Conference on Software Engineering.Hyderabad,India,2014:825-836.
[7]杨宇,张健.程序静态分析技术与工具[J].计算机科学,2004,31(2):171-174.
[8]SOR V,TREIER T,Srirama S N.Improving statistical approach for memory leak detection using machine learning[C]∥International Conference on Software Maintenance.Eindhoven,Netherlands,2013:22-28.
[9]SUI Y L,YE D,XUE J L.Detecting Memory Leakd Statically with Full-Sparse Value-Flow Analysis[J].IEEE Transactions on Software Engineering,2014,40(2):107-122.
[10]LIM W,PARK S,HAN H.Memory leak detection with context awareness[C]∥Reliable and Autonomous ComputationalScie-nce Conference.San Antonio,USA,2012:276-281.
[11]JOY M M,MUELLER W,RAMMIG F J.Source code annotated memory leak detection for soft real time embedded systems with resource constraints[C]∥International Conference on Dependable,Autonomic and Secure Computing.Dalian,China,2014:166-172.
[12]KANVAR V,KHEDKER U P.Heap abstractions for staticanalysis[J].ACM Computing Surveys,2016,49(2):1-29.
[13]付晓毓,朱利,顾伟.基于模型检测的内存泄露静态测试方法[J].微电子学与计算机,2010,27(10):170-173.
[14]XU Z B,ZHANG J,XU Z X.Memory leak detection based on memory state transition Graph[C]∥Asia-Pacific Software Engineering Conference.Ho Chi Minh,Vietnam,2011:33-40.
[15]张仕金.基于Cppcheck软件缺陷模式的研究与定位[D].重庆:重庆大学,2014.
[16]侯洛明.程序静态分析的通用方法[J].计算机学报,1987,2:74-81.
[17]ALT M,MARTIN F.Lecture Notes in Computer Science[M].US,Berlin:Springer,2005.
[18]李平华.过程间数据流分析技术研究[D].南京:东南大学,2004.
[19]CppCheck[OL].trac.cppcheck.net/wiki.
[20]Splint[OL].http://www.splint.org/.
[21]姬秀娟.资源泄漏故障静态分析的关键技术的研究[D].天津:南开大学计算机与控制工程学院,2014.
[22]Standard Performance Evaluation Corporation(SPEC)[OL].http://www.spec.org/cpu/.
[1] LI Yin, LI Bi-xin. Memory Leak Test Acceleration Based on Script Prediction and Reconstruction [J]. Computer Science, 2020, 47(9): 31-39.
[2] ZHANG Shan-bin, YUAN Jin-zhao, CHEN Hui, WANG Yu-rong, WANG Jie, TU Chang-he. Vehicle Self-localization Based on Standard Road Sign [J]. Computer Science, 2020, 47(7): 97-102.
[3] XING Yu-hua, LI Ming-xing. Robust Low Rank Subspace Clustering Algorithm Based on Projection [J]. Computer Science, 2020, 47(6): 92-97.
[4] NING Ze-xi, QIN Xu-jia, CHEN Jia-zhou. Video Fusion Method Based on 3D Scene [J]. Computer Science, 2020, 47(11A): 281-285.
[5] GUO Lan-ying, HAN Rui-zhi, CHENG Xin. Digital Instrument Identification Method Based on Deformable Convolutional Neural Network [J]. Computer Science, 2020, 47(10): 187-193.
[6] ZHANG Zhuang, LI Lin-lin, YU Hong-feng, FAN Bao-qing. Effectiveness Evaluation of Command and Control System Based on Improved Projection Pursuit and Grey Correlation Method [J]. Computer Science, 2019, 46(9): 298-302.
[7] LI De-quan, DONG Qiao, ZHOU Yue-jin. Distributed Online Conditional Gradient Optimization Algorithm [J]. Computer Science, 2019, 46(3): 332-337.
[8] ZHANG Zong-mei, GUI Sheng-lin, REN Fei. Android Malware Detection Based on N-gram [J]. Computer Science, 2019, 46(2): 145-151.
[9] YUE Chuan, PENG Xiao-hong. Evaluation Model of Software Quality with Interval Data [J]. Computer Science, 2019, 46(10): 209-214.
[10] FU Tai,YANG Li, WANG Bin. Projection Image Library Design Method for Aircraft CAD Model with Accurate Pose [J]. Computer Science, 2018, 45(6A): 244-246.
[11] ZHANG Yong and WAN Ming-hua. Generalized Discriminant Local Median Preserving Projections and Face Recognition [J]. Computer Science, 2018, 45(2): 90-93.
[12] ZHOU Yun, JIANG Fu. Improved Marching Cubes Based on CUDA [J]. Computer Science, 2018, 45(11A): 573-575.
[13] MA Xiao-jun, GUO Jian-yi, XIAN Yan-tuan, MAO Cun-li, YAN Xin and YU Zheng-tao. Entity Hyponymy Acquisition and Organization Combining Word Embedding and Bootstrapping in Special Domain [J]. Computer Science, 2018, 45(1): 67-72.
[14] WU Xiao-yan, HUANG Jia-qi and BU Xiang-wei. Adaptive Backstepping Controler of Quadrotor UAV [J]. Computer Science, 2017, 44(Z6): 526-528.
[15] XUE Xiao-yu and MA Xiao-hu. Double Adjacency Graphs Based Orthogonal Neighborhood Preserving Projections for Face Recognition [J]. Computer Science, 2017, 44(8): 31-35.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
[1] LEI Li-hui and WANG Jing. Parallelization of LTL Model Checking Based on Possibility Measure[J]. Computer Science, 2018, 45(4): 71 -75 .
[2] SUN Qi, JIN Yan, HE Kun and XU Ling-xuan. Hybrid Evolutionary Algorithm for Solving Mixed Capacitated General Routing Problem[J]. Computer Science, 2018, 45(4): 76 -82 .
[3] ZHANG Jia-nan and XIAO Ming-yu. Approximation Algorithm for Weighted Mixed Domination Problem[J]. Computer Science, 2018, 45(4): 83 -88 .
[4] WU Jian-hui, HUANG Zhong-xiang, LI Wu, WU Jian-hui, PENG Xin and ZHANG Sheng. Robustness Optimization of Sequence Decision in Urban Road Construction[J]. Computer Science, 2018, 45(4): 89 -93 .
[5] SHI Wen-jun, WU Ji-gang and LUO Yu-chun. Fast and Efficient Scheduling Algorithms for Mobile Cloud Offloading[J]. Computer Science, 2018, 45(4): 94 -99 .
[6] ZHOU Yan-ping and YE Qiao-lin. L1-norm Distance Based Least Squares Twin Support Vector Machine[J]. Computer Science, 2018, 45(4): 100 -105 .
[7] LIU Bo-yi, TANG Xiang-yan and CHENG Jie-ren. Recognition Method for Corn Borer Based on Templates Matching in Muliple Growth Periods[J]. Computer Science, 2018, 45(4): 106 -111 .
[8] GENG Hai-jun, SHI Xin-gang, WANG Zhi-liang, YIN Xia and YIN Shao-ping. Energy-efficient Intra-domain Routing Algorithm Based on Directed Acyclic Graph[J]. Computer Science, 2018, 45(4): 112 -116 .
[9] CUI Qiong, LI Jian-hua, WANG Hong and NAN Ming-li. Resilience Analysis Model of Networked Command Information System Based on Node Repairability[J]. Computer Science, 2018, 45(4): 117 -121 .
[10] WANG Zhen-chao, HOU Huan-huan and LIAN Rui. Path Optimization Scheme for Restraining Degree of Disorder in CMT[J]. Computer Science, 2018, 45(4): 122 -125 .