Font Size: a A A

Static Program Analysis Based Program Repair For Null Pointer Dereferences

Posted on:2022-01-22Degree:MasterType:Thesis
Country:ChinaCandidate:R Y XuFull Text:PDF
GTID:2518306725984739Subject:Master of Engineering
Abstract/Summary:PDF Full Text Request
With the development of information technology,computer software has gradually become an indispensable part of people's lives.However,bugs inevitably existing in computer software,which may lead to serious consequences.Pointer,as one of the most important variable types in various programming languages,is widely used in the programming process of computer software.However,pointer is a double-edged sword.The use of pointer can simplify programming tasks,but it can also lead to bugs.Null pointer dereferences is one of the most common and serious bugs caused by the use of pointer,and thus,how to fix null pointer dereferences is a problem of widespread concern in the industry.However,in computer software with large code scale,manual repair of null pointer dereferences is inefficient,so assistance from automated program repair tools is required,but existing automatic program repair tools performs poorly on null pointer dereferences,which not only takes a long time in repair process,but also has low correct rate in generated patch.Based on the observations on the challenges of repair null pointer dereferences,we conduct research in this thesis on repair algorithm for null pointer dereferences in C/C++ program.In summary,we make the following main contributions:1.A static program analysis based algorithm for generating repair suggestions for null pointer dereferences in C/C++ programs is proposed.The algorithm takes trigger points of null pointer dereferences,the abstract syntax tree and inter-procedural control flow graph of source code as input,find a suitable repair code insertion point by tracing the dereferenced pointer at the trigger point,and finally generate repair suggestions according to the predefined templates.2.Based on the existing static program analysis platform,a program repair tool based on the algorithm proposed in this thesis is developed with C++ language.Each parts of the algorithm and the utility functions used are encapsulated to improve code quality.3.Use libjpeg-turbo and cpython as benchmark to evaluate the developed tool.Use static program analyzer infer to scan benchmark twice before and after the re-pair suggestions generated by developed tool is applied,then analyze the error reports produced by infer to evaluate the quality of the tool.The results show that the program repair tool developed based on the algorithm proposed in this the-sis can generate repair suggestions for libjpeg-turbo within 1 second,which can eliminate 100% of null pointer dereferences in libjpeg-turbo after suggestions is applied;generate repair suggestions for cpython within 14 seconds,which can eliminate 75.9% of null pointer dereferences in cpython after suggestions is ap-plied.
Keywords/Search Tags:Static Program Analysis, Program Repair, Null Pointer Dereference
PDF Full Text Request
Related items