Skip to main content

Static Detection Method for C/C++ Memory Defects Based on Triad Memory Model

  • Conference paper
  • First Online:
Geo-Spatial Knowledge and Intelligence (GSKI 2017)

Part of the book series: Communications in Computer and Information Science ((CCIS,volume 849))

Included in the following conference series:

  • 1099 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

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)

    Article  MathSciNet  Google Scholar 

  • Zhang, S., Shang, Z.: Software defect pattern analysis and location based on Cppcheck. Comput. Eng. Appl. 51(3), 69–73 (2015). (in Chinese)

    Google Scholar 

  • 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)

    Google Scholar 

  • Cherem, S., Princehouse, L., Rugina, R.: Practical memory leak detection using guarded value-flow analysis. In: Proceedings of PLDI, pp. 480–491 (2007)

    Article  Google Scholar 

  • 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)

    Google Scholar 

  • Li, Q., Pan, M., Li, X.: Memory leak detection tools and evaluation methods. Comput. Sci. Explor. 3(1), 29–35 (2010). (in Chinese)

    Google Scholar 

  • 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)

    Google Scholar 

  • 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)

    Google Scholar 

  • 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

    Chapter  Google Scholar 

  • 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)

    Article  Google Scholar 

  • 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)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Fusheng Jin .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer Nature Singapore Pte Ltd.

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics