Detecting concurrency bugs in Go programs can be a challenging task due to the language’s built-in support for concurrency through goroutines and channels. This paper proposes GoGuard, an efficient and precise static concurrency bug detector generalized for both traditional and Go-specific blocking bugs. This generic solution is powered by Resource Flow Graph which captures the communication mechanism among different Go concurrency primitives by a producer-consumer concept and detects blocking bugs by finding unmatched producers and consumers. Moreover, Resource Flow Graph incorporates happens-before relations in the same manner, which inspires our may-happen-in-parallel analysis, Static Happens-In-Parallel Simulation, that achieves randomness akin to real-world execution and avoids expensive graph traversal. We evaluate GoGuard on GoBench and large, real-world Go projects, e.g. gRPC, Istio, Etcd and Serving. We also compare with GCatch, a state-of-the-art Go concurrency bug detector. The result demonstrates the efficiency and precision of GoGuard: GoGuard is 30x faster on real-world Go projects and detects 10 more true blocking bugs than GCatch.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

GoGuard: Efficient Static Blocking Bug Detection for Go

  • Bozhen Liu,
  • Dhruti Joshi

摘要

Detecting concurrency bugs in Go programs can be a challenging task due to the language’s built-in support for concurrency through goroutines and channels. This paper proposes GoGuard, an efficient and precise static concurrency bug detector generalized for both traditional and Go-specific blocking bugs. This generic solution is powered by Resource Flow Graph which captures the communication mechanism among different Go concurrency primitives by a producer-consumer concept and detects blocking bugs by finding unmatched producers and consumers. Moreover, Resource Flow Graph incorporates happens-before relations in the same manner, which inspires our may-happen-in-parallel analysis, Static Happens-In-Parallel Simulation, that achieves randomness akin to real-world execution and avoids expensive graph traversal. We evaluate GoGuard on GoBench and large, real-world Go projects, e.g. gRPC, Istio, Etcd and Serving. We also compare with GCatch, a state-of-the-art Go concurrency bug detector. The result demonstrates the efficiency and precision of GoGuard: GoGuard is 30x faster on real-world Go projects and detects 10 more true blocking bugs than GCatch.