Skip to content

Goroutine leak detector #12989

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
klauspost opened this issue Oct 19, 2015 · 2 comments
Closed

Goroutine leak detector #12989

klauspost opened this issue Oct 19, 2015 · 2 comments

Comments

@klauspost
Copy link
Contributor

In my experience it could be very valuable to have a goroutine "leak" detection similar to the race detector we already have. It should be able to detect goroutines that will never we runnable again, and therefore is "leaked".

I have created a playground example of the things I could imagine would be detectable, which are blocking selects, sync.Mutex, sync.WaitGroup, sync.Cond, where no other goroutine holds a reference to the item needing to unblock it.

The examples are of course very simple, but I don't see why it shouldn't apply in a much bigger scope.

I imagine this could be used in a similar fashion as the race detector, so it is an option that can be used for testing, problem identification, etc.

@adg
Copy link
Contributor

adg commented Oct 19, 2015

Sounds like a nice research project. We can re-open this issue if/when someone wants to work on it.

@adg adg closed this as completed Oct 19, 2015
@bradfitz
Copy link
Contributor

Related: #6705 (testing: add test helpers for measuring goroutine leaks), which I was just working on the other day.

But this bug is a dup of #5308 which is still open.

fortytw2 added a commit to fortytw2/leaktest that referenced this issue Apr 29, 2016
@golang golang locked and limited conversation to collaborators Oct 24, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants