Abstract
Memory leak detection for C programs is a significant while difficult research field. Based on executable formal semantics of C programming language, a new method is proposed in this paper for memory leak detection. By extending and modifying state Configuration and rules of memory manipulation and pointer manipulation in semantics, this method can employ the powerful expression and executive capacity of rewriting logic to describe both behaviors of memory operation such as malloc, free, pointer and unit of scope, and memory leak pattern of C programs in executable semantics. Because the modified state Configuration and rules are executable, the memory leak flaws can be matched and detected automatically by execution. Three typical memory leak flaws, namely unreleased allocated-memory, pointer reassigning and inconsistency between allocated space and released space, are tested with some code segments containing them to verify the method. The results and testing time show that the semantics-based method can detect memory leak flaws in C programs effectively.
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.