Font Size: a A A

Research And System Implementation Of Concurrency Bugs Fixing Technology Based On Templates

Posted on:2024-02-17Degree:MasterType:Thesis
Country:ChinaCandidate:Y C YuanFull Text:PDF
GTID:2568306914494354Subject:Software engineering
Abstract/Summary:PDF Full Text Request
With the development of multi-core processor and the improvement of processor performance,concurrent programs are widely used in the development of software systems.Due to its inherent concurrency,the uncertainty of thread scheduling and the large size of code,concurrent programs are prone to concurrency bugs.Concurrency bugs usually cause programs or systems to fall into an uncertain running state,and even bring about severe consequences such as system crash,resulting in huge economic losses.However,concurrency bugs are often exposed to rare and specific interleaved execution,making it difficult for developers to detect,locate and fix them effectively and efficiently.Therefore,the research on concurrency bugs fixing has become a hot issue in academia and industry in recent years.Currently,most approaches fix concurrency bugs by serializing the execution of all threads involved in the bugs by statically or dynamically inserting a gate lock,but these approaches carry a significant risk of deadlock,and may bring high time cost.In view of the problems existing in the approaches of automated concurrency bugs fixing,this thesis carries out the research of concurrency bugs fixing technology based on the templates and constructs an automated concurrency bugs fixing system.This thesis primarily consists of the following aspects:1)A template-based approach for fixing deadlocks caused by ReentrantLock is proposed.After analyzing a large number of deadlock programs caused by ReentrantLock,we define 10 fix templates.Next,we use abstract syntax tree to represent the buggy program.The deadlocks are detected,located,and fixed based on predefined templates by searching and modifying node information in the abstract syntax tree.Experimental results show that the approach can efficiently fix 156 out of 177 deadlocks caused by ReentrantLock in Java projects.It does a better job of detecting deadlocks than static analysis tool Findbugs.2)A template-based concurrency bugs fixing approach is proposed.First,we screen and extract patch codes corresponding to concurrency bugs from massive source code.Then,we construct fine-grained semantic change graphs for patch codes to preserve the syntactic and semantic information of source code.Next,a search index is constructed to solve the spatial explosion caused by direct pairwise comparison of fine-grained semantic change graphs.Then,we use clustering algorithm to mine fix templates.Finally,we build the program to be repaired as an abstract syntax tree,and match it with the template to fix concurrency bugs.Experimental results show that our approach can effectively fix more concurrency bugs in real-world Java projects.Its fixing accuracy rate and recall rate are 48.47%and 59.53%,respectively,and its performance is superior to other approaches.3)An automated concurrency bug fixing system is deployed.The system provides concurrency bug management,ReentrantLock deadlock fixing,concurrency bug fixing and other functions,which can be used to assist developers to analyze concurrent programs and automatically fix concurrency bugs.What’s more,it can improve the quality and maintenance efficiency of concurrent software.
Keywords/Search Tags:concurrency bugs fixing, deadlock, ReentrantLock, code representation, clustering
PDF Full Text Request
Related items