Who goes first? detecting go concurrency bugs via message reordering
- 22 February 2022
- conference paper
- conference paper
- Published by Association for Computing Machinery (ACM) in Proceedings of the 27th ACM International Conference on Architectural Support for Programming Languages and Operating Systems
Abstract
Go is a young programming language invented to build safe and efficient concurrent programs. It provides goroutines as lightweight threads and channels for inter-goroutine communication. Programmers are encouraged to explicitly pass messages through channels to connect goroutines, with the purpose of reducing the chance of making programming mistakes and introducing concurrency bugs. Go is one of the most beloved programming languages and has already been used to build many critical infrastructure software systems in the data-center environment. However, a recent study shows that channel-related concurrency bugs are still common in Go programs, severely hurting the reliability of the programs. This paper presents GFuzz, a dynamic detector that can effectively pinpoint channel-related concurrency bugs by mutating the processing orders of concurrent messages. We build GFuzz in three steps. We first adopt an effective approach to identify concurrent messages and transform a program to process those messages in any given order. We then take a fuzzing approach to generate new processing orders by mutating exercised ones and rely on execution feedback to prioritize orders close to triggering bugs. Finally, we design a runtime sanitizer to capture triggered bugs that are missed by the Go runtime. We evaluate GFuzz on seven popular Go software systems, including Docker, Kubernetes, and gRPC. GFuzz finds 184 previously unknown bugs and reports a negligible number of false positives. Programmers have already confirmed 124 reports as real bugs and fixed 67 of them based on our reporting. A careful inspection of the detected concurrency bugs from gRPC shows the effectiveness of each component of GFuzz and confirms the components' rationality.Keywords
Funding Information
- National Science Foundation (CNS-1955965)
This publication has 29 references indexed in Scilit:
- Fencing off go: liveness and safety for channel-based programmingPublished by Association for Computing Machinery (ACM) ,2017
- Sound static deadlock analysis for C/PthreadsPublished by Association for Computing Machinery (ACM) ,2016
- Static deadlock detection for concurrent go by global session graph synthesisPublished by Association for Computing Machinery (ACM) ,2016
- Stateless model checking concurrent programs with maximal causality reductionPublished by Association for Computing Machinery (ACM) ,2015
- A large scale study of programming languages and code quality in githubPublished by Association for Computing Machinery (ACM) ,2014
- A Sound Reduction of Persistent-Sets for Deadlock Detection in MPI ApplicationsLecture Notes in Computer Science, 2012
- Race directed random testing of concurrent programsPublished by Association for Computing Machinery (ACM) ,2008
- Conditional must not aliasing for static race detectionPublished by Association for Computing Machinery (ACM) ,2007
- Effective static race detection for JavaPublished by Association for Computing Machinery (ACM) ,2006
- An empirical study of the reliability of UNIX utilitiesCommunications of the ACM, 1990