Skip to content
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

proposal: runtime: Expose a function to enable GODEBUG="tracebackancestors=N" on runtime #52093

Open
ysmood opened this issue Apr 1, 2022 · 2 comments · May be fixed by #52097
Open

proposal: runtime: Expose a function to enable GODEBUG="tracebackancestors=N" on runtime #52093

ysmood opened this issue Apr 1, 2022 · 2 comments · May be fixed by #52097
Labels
Projects
Milestone

Comments

@ysmood
Copy link

@ysmood ysmood commented Apr 1, 2022

I'm making a lib to detect goroutine leaks, if we don't enable tracebackancestors it will be impossible to detect goroutine leaks in testing when testing.T.isParallel is enabled.

If we can add a function in runtime, such as runtime.TracebackAncestors(n int) then we don't have to add protection code like this:

https://github.com/ysmood/gotrace/blob/03c1fdd54f28e0778ae12534167858777a00ddcd/utils.go#L31-L38

@ysmood ysmood added the Proposal label Apr 1, 2022
@gopherbot gopherbot added this to the Proposal milestone Apr 1, 2022
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Apr 1, 2022

Perhaps we should have a general mechanism for setting GODEBUG values that are used by the runtime.

@ianlancetaylor ianlancetaylor added this to Incoming in Proposals Apr 1, 2022
ysmood added a commit to ysmood/go that referenced this issue Apr 1, 2022
@ysmood ysmood linked a pull request Apr 1, 2022 that will close this issue
ysmood added a commit to ysmood/go that referenced this issue Apr 1, 2022
@gopherbot
Copy link

@gopherbot gopherbot commented Apr 1, 2022

Change https://go.dev/cl/397517 mentions this issue: runtime: resolve #52093

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Proposals
Incoming
Development

Successfully merging a pull request may close this issue.

3 participants