The Go language (Go/Golang) has been attracting increasing attention from the industry in recent years due to its straightforward syntax, strong concurrency support, and ease of deployment. This programming language encourages developers to use channel-based concurrency, which simplifies development. Unfortunately, it also introduces new concurrency problems that differ from those caused by the mechanism of shared memory concurrency. Despite this, there are only few works that aim to detect these Go-specific concurrency issues. Even state-of-the-art testing tools will miss critical concurrent bugs that require fine-grained and effective interleaving exploration.
This paper presents GoPie, a novel testing approach for detecting Go concurrent bugs through primitive-constrained interleaving exploration. GoPie utilizes execution histories to identify new interleavings instead of relying on exhaustive exploration or random scheduling. To evaluate its effectiveness, we applied GoPie on existing benchmarks and large-scale open-source projects. Results show that GoPie can effectively explore concurrent interleavings and detect significantly more bugs in the benchmark. Furthermore, it uncovered 11 unique previously unknown concurrent bugs, and 9 of which have been confirmed.