Memory Leak Detection in IoT Program Based on an Abstract Memory Model SeqMM

With the rapid growth of the Internet-of-Things (IoT), security issues for the IoT are becoming increasingly serious. Memory leaks are a common and harmful software defect for IoT programs running on resource-limited devices. Static analysis is an effective method for memory leak detection, however, because the existing methods cannot fully describe the memory state of IoT programs at run time, false positives and false negatives frequently occur. To improve the precision of memory leak detection, we propose an abstract memory model SeqMM to describe sequential storage structures. SeqMM differs from other abstract memory models in its ability to handle both points-to analysis and numerical analysis of pointers, which contributes to eliminating false positives in defect detection. In addition, based on the analysis of the sequential storage structure, we introduce the analysis of its operations in C programs, including transfer operations and predicate operations. Moreover, we present a memory leak detection algorithm by determining the state of the program points related to allocated memory blocks. The experimental results of five real projects indicate that the false positive rates of DTSC_SeqMM, Klocwork12 and DTSC_RSTVL are 29.0%, 15.0% and 40.6% respectively, and the corresponding false negative rates are 0%, 22.7% and 13.6%.

[1]  Uday P. Khedker,et al.  Computing partially path-sensitive MFP solutions in data flow analyses , 2018, CC.

[2]  Li Yue Precision-Guided Context Sensitivity for Pointer Analysis , 2018 .

[3]  Yueshen Xu,et al.  QoS Prediction for Service Recommendation with Deep Feature Learning in Edge Computing Environment , 2019, Mob. Networks Appl..

[4]  Jian Zhang,et al.  A Memory Model for Static Analysis of C Programs , 2010, ISoLA.

[5]  Noam Rinetzky,et al.  Field-sensitive program dependence analysis , 2010, FSE '10.

[6]  Bjarne Steensgaard,et al.  Points-to analysis in almost linear time , 1996, POPL '96.

[7]  Guangquan Xu,et al.  A Secure Random Key Distribution Scheme Against Node Replication Attacks in Industrial Wireless Sensor Systems , 2020, IEEE Transactions on Industrial Informatics.

[8]  Jingling Xue,et al.  Value-Flow-Based Demand-Driven Pointer Analysis for C and C++ , 2020, IEEE Transactions on Software Engineering.

[9]  Honghao Gao,et al.  Applying Probabilistic Model Checking to Path Planning in an Intelligent Transportation System Using Mobility Trajectories and Their Statistical Data , 2019, Intelligent Automation and Soft Computing.

[10]  Dong Yu Static Analysis of C Programs via Region-Based Memory Model , 2014 .

[11]  Xuyun Zhang,et al.  A QoS-aware virtual machine scheduling method for energy conservation in cloud-based cyber-physical systems , 2019, World Wide Web.

[12]  Chunhua Su,et al.  Am I eclipsed? A smart detector of eclipse attacks for Ethereum , 2020, Comput. Secur..

[13]  Santosh Pande,et al.  Automated memory leak detection for production use , 2014, ICSE.

[14]  Qiming Zou,et al.  Research on Cost-Driven Services Composition in an Uncertain Environment , 2019 .

[15]  Yu Li,et al.  Group-Wise Itinerary Planning in Temporary Mobile Social Network , 2019, IEEE Access.

[16]  Yukun Dong A sound abstract memory model for static analysis of C programs , 2018, Int. J. Comput. Sci. Eng..

[17]  Patrick Th. Eugster,et al.  Detecting Abnormalities in IoT Program Executions through Control-Flow-Based Features: Poster Abstract , 2017, IoTDI.

[18]  Emery D. Berger,et al.  DoubleTake: Fast and Precise Error Detection via Evidence-Based Dynamic Analysis , 2016, 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE).

[19]  Jingling Xue,et al.  Sparse flow-sensitive pointer analysis for multithreaded programs , 2016, 2016 IEEE/ACM International Symposium on Code Generation and Optimization (CGO).

[20]  Jingling Xue,et al.  SPAS: Scalable Path-Sensitive Pointer Analysis on Full-Sparse SSA , 2011, APLAS.

[21]  Sandeep Dasgupta,et al.  Precise shape analysis using field sensitivity , 2012, SAC.

[22]  Ondrej Lhoták,et al.  Context transformations for pointer analysis , 2017, PLDI.

[23]  Jon D. Hagar Software Test Architectures and Advanced Support Environments for IoT , 2018, 2018 IEEE International Conference on Software Testing, Verification and Validation Workshops (ICSTW).

[24]  Yunzhan Gong,et al.  STVL: Improve the Precision of Static Defect Detection with Symbolic Three-Valued Logic , 2011, 2011 18th Asia-Pacific Software Engineering Conference.

[25]  Lars Ole Andersen,et al.  Program Analysis and Specialization for the C Programming Language , 2005 .

[26]  James C. King,et al.  Symbolic execution and program testing , 1976, CACM.

[27]  Deepak D'Souza,et al.  Scalable Flow-Sensitive Pointer Analysis for Java with Strong Updates , 2012, ECOOP.

[28]  Yueshen Xu,et al.  QoS Prediction for Mobile Edge Service Recommendation With Auto-Encoder , 2019, IEEE Access.

[29]  Jian Zhang Symbolic execution of program paths involving pointer structure variables , 2004 .

[30]  Artur Andrzejak,et al.  Poster: Memory and Resource Leak Defects in Java Projects: An Empirical Study , 2018, 2018 IEEE/ACM 40th International Conference on Software Engineering: Companion (ICSE-Companion).

[31]  Joxan Jaffar,et al.  A path-sensitively sliced control flow graph , 2014, SIGSOFT FSE.

[32]  Lilan Liu,et al.  Automated Quantitative Verification for Service-Based System Design: A Visualization Transform Tool Perspective , 2018, Int. J. Softw. Eng. Knowl. Eng..

[33]  Isil Dillig,et al.  Bottom-Up Context-Sensitive Pointer Analysis for Java , 2015, APLAS.

[34]  Eric Bodden,et al.  Context-, flow-, and field-sensitive data-flow analysis using synchronized Pushdown systems , 2019, Proc. ACM Program. Lang..

[35]  Yin Bang-h Analysis of Programs with Pointer Arithmetic by Combining Points-to and Numerical Abstractions , 2015 .

[36]  Jingling Xue,et al.  On-demand strong update analysis via value-flow refinement , 2016, SIGSOFT FSE.

[37]  Wanchun Dou,et al.  Dynamic Mobile Crowdsourcing Selection for Electricity Load Forecasting , 2018, IEEE Access.

[38]  Radu Rugina,et al.  Region-based shape analysis with tracked locations , 2005, POPL '05.

[39]  Yannis Smaragdakis,et al.  P/Taint: unified points-to and taint analysis , 2017, Proc. ACM Program. Lang..

[40]  Gong Yunzhan,et al.  A Defect Model Based Testing System , 2008 .

[41]  Bin Yu,et al.  A dynamic approach to detecting, eliminating and fixing memory leaks , 2019, J. Comb. Optim..