3 ms·
While using the described pattern analysis can be an interesting tool to find bugs in other peoples software (what Trail of Bits are doing) or maybe for integra
by eis 5y ago
While using the described pattern analysis can be an interesting tool to find bugs in other peoples software (what Trail of Bits are doing) or maybe for integrating it into a static code analysis tool like "go vet" to prevent the offending code even getting into production, discovering goroutine leaks in your own program once they happen is not that difficult in most cases from my experience. You just dump the stack of all goroutines via for example runtime.GoroutineProfile() or using pprof and it becomes obvious very quickly where goroutines are leaking. And this way you are not limited to concurrency bugs caused by communicating over channels.