Font Size: a A A

Research And Implementation Of Memory Leak Detection For Dynamic Array In Fortran Program

Posted on:2024-07-30Degree:MasterType:Thesis
Country:ChinaCandidate:K LuoFull Text:PDF
GTID:2568306944957879Subject:Computer Science and Technology
Abstract/Summary:PDF Full Text Request
Memory leak is a common problem in languages without garbage collection mechanisms.Although Fortran95 introduced ALLOCATABLE arrays to solve some of the leak problem,improper operations related to memory resources through pointer arrays can still cause leaks.Most of the historical projects of military industrial research institutes have not been adapted and adjusted with the change of Fortran version.The complex program structure can easily cause negligence in memory management,and lead to memory resource leakage.The existing research is not suitable for the detection process of Fortran dynamic array memory leaks.There is still room for optimization in terms of efficiency and accuracy for Fortran memory state analysis.Aiming at the above problems,this paper proposes a static detection method for Fortran dynamic array memory leak faults based on defect mode state machine.Around this method,this paper mainly conducts corresponding research from the following aspects:(1)In terms of detecting object models,according to the method and characteristics of Fortran dynamic array management memory resources,the modeling of the program is improved and optimized,the pointer reference control flow graph(PR-CFG)is introduced to describe the reference relationship of the pointer array,the unnecessary control flow is simplified to improve the efficiency of analysis,and the construction is more in line with the program model for this defect.(2)In terms of detection status description,according to the Fortran memory management mechanism and the use characteristics of dynamic arrays,the memory status information of Fortran program nodes is described by symbolic language,and the program status of nodes is calculated along the control flow,the influence of different paths is recorded at the same time,finally the symbolic function summary based on program status are generated for path-sensitive analysis between procedures.(3)In terms of detection process,summarize the Fortran dynamic array memory leak mode,abstract it as a defect mode state machine,and design the corresponding state transition algorithm,and transform the memory leak detection into the forward data flow problem of calculating the state set of the defect mode state machine instance.The detection method proposed in this paper has been applied to the DTS-Fortran module of the defect detection system developed by our research group,and three sets of comparative experiments were designed to carry out the test.According to the experimental results,the overall false alarm rate and relative false negative rate have been greatly reduced after applying the method in this paper,and the detection efficiency has also been greatly improved.At the same time,it verifies the superiority of this method in detecting Fortran dynamic array memory leak faults compared with domestic and foreign detection tools.
Keywords/Search Tags:dynamic arrays, memory leak detection, PR-CFG, symbolic function summary, state transition
PDF Full Text Request
Related items