| Fortran is one of the most popular programming languages in the field of high-performance computing.Developers use array pointers in Fortran to create and manipulate dynamic arrays to improve programming efficiency,but the existence of array pointers may introduce new security issues.Dangling reference is one of the most harmful types,which may lead to serious consequences such as program crashes.Array pointers in Fortran can remap arrays or point to non-continuous parts of arrays.Traditional detection methods do not fully consider such situations,and only focus on the pointing relationship of array pointers during analysis,making it difficult for them to effectively detect dangling reference faults caused by array pointers in Fortran.In this paper,a method for detecting dangling references of Fortran array pointers is proposed.The related work is as follows:(1)According to the syntax and semantics of array pointers in Fortran,an abstract memory model oriented to array pointers is proposed.The model can describe memory states of array pointers when the Fortran program is running.The model records the dimension and range information of array pointers,providing memory support for subsequent detection.(2)The dangling reference problem of Fortran array pointer is abstracted as a fault model,which is described by defect mode state machine.This paper gives the state set,state transition condition and state transition action of dangling reference state machine.(3)A method for inter-procedural analysis of Fortran array pointers based on function summaries is proposed.Function information related to dangling reference faults is stored in the summaries.Then according to the value of the array pointer obtained by data flow analysis,the detection algorithm based on the dangling reference state machine is used on the control flow node to complete the dangling reference fault detection.The method proposed in this paper has been applied in the detection tool DTS_aptMM.In this paper,the experiment is carried out by testing the Fortran open source project.The experimental results show that the false positive rate and the false negative rate of DTS_aptMM after applying the method in this paper are significantly reduced;when compared with other detection tools,the detection effect of DTS_aptMM is in the forefront of the selected tools,which proves the feasibility and effectiveness of the method in this paper. |