This thread seems appropriate to point out a recent study over real-world concurrency bugs in Go.
The paper is available at https://songlh.github.io/paper/go-study.pdf, and there is a nice wrap-up blog post about it: https://blog.acolyer.org/2019/05/17/understanding-real-world-concurrency-bugs-in-go/.
Distinct projects are examined to find whether concurrency bugs are related to channels or sharing memory.
Some interesting facts (read on the references for nicer overview) :
- 38.6% of examined bugs involve message passing.
- Message passing seems to introduce more blocking issues (e.g. starving coroutines) than memory sharing does.
- Go’s runtime race detector
- detected 2 over 21 reproduced “blocking” bugs.
- detected half of reproduced “non-blocking” bugs.
Among the causes, authors point out :
- Coroutine creation with closures
- Buffered vs unbuffered channel implications
- Usage of select