Font Size: a A A

Detection Of Concurrent Bugs Under The Go's Message-passing Mechanism

Posted on:2022-08-01Degree:MasterType:Thesis
Country:ChinaCandidate:P H QiFull Text:PDF
GTID:2518306737478834Subject:Computer technology
Abstract/Summary:PDF Full Text Request
Google introduced Golang(later referred to as Go)in 2009,the developers of Go proposed a new concurrency mechanism based on CSP concurrency theory,and the new concurrency mechanism also brings new concurrency bugs.Most of the current concurrency bug detection tools are designed to detect concurrency bugs caused by the shared-memory based concurrency mechanism in traditional programming languages,they are powerless to bugs caused by the message-passing based concurrency mechanism in Go.Most of the existing Go language concurrency bug detection tools are based on model checking tools,which examine every statement in the whole program and convert them into a form that can be recognized by the model checking tool,then they input all the converted statements as a whole into the model checking tool,and finally take the output of the model detection tool as the result of concurrency bug detection for the program.This approach can only qualitatively obtain the concurrency of the whole program and cannot detect concurrency bugs caused by some concurrency features such as Wait Group.To solve this problem,we propose a concurrency bug detection method for Go language,which first traverses the entire program with the help of static analysis to collect the channels and Wait Group variables present in the program to analyzes the concurrent operations of different channels and Wait Group variables in the program,we describe all the concurrent operations in the program's source code using defined structures,and then detect the concurrency bugs.The concurrent operations in the program source code are described using the defined structures,and the corresponding concurrent operation sequences are generated based on the happens-before analysis.A channel detection algorithm is designed to detect potential concurrency bugs for the concurrent operation sequences of channels,and a push-down automaton is used to verify the correctness of the Wait Group variables in the program.Finally,some of the keywords(Once,defer,etc.)in the program that may affect the concurrency detection results are verified to determine the number of different kinds of concurrency bugs in the source program.Based on this method,we implement a concurrency bug detection tool named GCDetector.In order to verify the effectiveness of GCDetector,30 benchmark programs were selected and experiments were conducted on these benchmark programs using GCDetector and the results were compared with the existing concurrency detection tools Godel and Gomela.The results show that the tool is effective in detecting concurrency bugs in the Go language.
Keywords/Search Tags:Concurrency, Channel, Bug detection, Static analysis, Pushdown automaton
PDF Full Text Request
Related items