| In safety-critical embedded systems,the computer resources that the program can operate are very limited.Therefore,before the program is deployed and run,static analysis method should be used to determine the upper bound of the program’s resource usage,which helps optimize the program’s resource usage configuration,and is of great significance to ensure the safe operation of the program.interpretation is an important technique for numerical program analysis,based on which many successful static analysis tools have been developed.The resource usage upper bound is an important numerical property of the program.However,the manipulation of dynamically allocated type resources such as heap memory that are allocated and released through system function calls often relies on complex pointer operations.Therefore,it is difficult to directly solve the upper bound of the resource usages by simply using abstract interpretation techniques.For this reason,based on the abstract interpretation framework,we propose an upper bound analysis method combining numerical analysis and pointer analysis for dynamic allocation type resource usage.To track the usage of dynamically allocated type resources in the program,we first introduce numerical auxiliary variables into the program to model their resource usage.Then,based on the abstract interpretation theory,we design a Points-to abstract domain to realize the coordination of numerical analysis and pointer analysis,so as to deal with resource allocation and release related operations and pointer arithmetic in the program.Finally,the resource usage upper bound at each program location can be inferred by the numerical range of these resource modeling auxiliary variables,On this basis,we make domain-sensitive analysis optimization for pointer analysis to improve the accuracy of pointer analysis,thus obtain a more accurate upper bound of resource usage.In order to improve the accuracy of numerical analysis of complex loop structures in abstract interpretation,we use the existing upper bound analysis tools of loop times to assist in the analysis.Finally,we use program slicing by considering resource modeling auxiliary variables as the slicing standard to obtain the minimum program related to resource usage,thereby increasing the scale of the upper bound analysis.We have developed a prototype to realize resource usage upper bound analysis,which mainly includes four components: code instrumentation,abstract interpretation analysis,loop upper bound solving and program slicing.Then,we use this tool to conduct experiments on real software programs and complex programs constructed.Experimental results show that this tool can effectively analyze the upper bound usages of various types resources such as heap memory,sockets and file handles in the program,and can improve the accuracy and scale of analysis. |