Abstract
The improper use of pointers in C/C++ programming language brings about a lot of memory-related issues. In this paper, causes of four kinds of memory defects are analyzed and summarized. Besides, a novel triad memory model has been proposed. Based on the model and the variable life cycle methodology, an approach for inner-procedure and inter-procedure detection has been presented too. Eventually, the prototype CAnalyzer is implemented on the basis of Clang static analyzer. Experiment results show that CAnalyzer can effectively detect the four types of memory defects.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Xu, Z., Zhang, J., Xu, Z.: Melton: a practical and precise memory leak detection tool for C programs. Front. Comput. Sci. 9(1), 34–54 (2015)
Zhang, S., Shang, Z.: Software defect pattern analysis and location based on Cppcheck. Comput. Eng. Appl. 51(3), 69–73 (2015). (in Chinese)
Jung, Y., Yi, K.: Practical memory leak detector based on parameterized procedural summaries. In: Proceedings of the 7th International Symposium on Memory Management, pp. 131–140. ACM (2008)
Cherem, S., Princehouse, L., Rugina, R.: Practical memory leak detection using guarded value-flow analysis. In: Proceedings of PLDI, pp. 480–491 (2007)
Sui, Y., Ye, D., Xue, J.: Static memory leak detection using full-sparse value-flow analysis. In: Proceedings of International Symposium on Software Testing and Analysis. pp. 254–264 (2012)
Li, Q., Pan, M., Li, X.: Memory leak detection tools and evaluation methods. Comput. Sci. Explor. 3(1), 29–35 (2010). (in Chinese)
Wang, S., Quan, Y., Sun, J.: False positive recognition method for hull pointer reference defect based on classification. J. Comput. Appl. 10(2968), 2972–3005 (2017). (in Chinese)
Li, X., Zhou, Y., Li, M.C., Chen, Y.J., Xu, G.Q., Wang, L.Z., Li, X.D.: Automatically validating static memory leak warnings for C/C++ programs. Ruan Jian Xue Bao/J. Softw. 28(4), 827–844 (2017). (in Chinese)
Xu, Z., Kremenek, T., Zhang, J.: A memory model for static analysis of C programs. In: Margaria, T., Steffen, B. (eds.) ISoLA 2010. LNCS, vol. 6415, pp. 535–548. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-16558-0_44
Alam, S., Qu, Z., Riley, R., et al.: DroidNative: automating and optimizing detection of android native code malware variants. Comput. Secur. 65, 230–246 (2017)
Xie, Y., Aiken, A.: Context-and path-sensitive memory leak detection. In: ACM SIGSOFT Software Engineering Notes, vol. 30(5), pp. 115–125. ACM (2005)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2018 Springer Nature Singapore Pte Ltd.
About this paper
Cite this paper
Wang, Y., Jin, F., Han, X., Wang, R. (2018). Static Detection Method for C/C++ Memory Defects Based on Triad Memory Model. In: Yuan, H., Geng, J., Liu, C., Bian, F., Surapunt, T. (eds) Geo-Spatial Knowledge and Intelligence. GSKI 2017. Communications in Computer and Information Science, vol 849. Springer, Singapore. https://doi.org/10.1007/978-981-13-0896-3_7
Download citation
DOI: https://doi.org/10.1007/978-981-13-0896-3_7
Published:
Publisher Name: Springer, Singapore
Print ISBN: 978-981-13-0895-6
Online ISBN: 978-981-13-0896-3
eBook Packages: Computer ScienceComputer Science (R0)