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: cmd/go: go test: set GODEBUG=tracebackancestors by default #69192

Closed
myaaaaaaaaa opened this issue Sep 1, 2024 · 3 comments
Closed
Labels
Milestone

Comments

@myaaaaaaaaa
Copy link

Proposal Details

By default, a panicking goroutine's stack trace ends at the go line:

1725135532

The GODEBUG=tracebackancestors environment variable addresses this. Presumably, it has some kind of runtime cost that prevents it from being set by default - hence, this proposal to have it apply only during testing.

Having this on by default would improve the debugging experience for all users who need to work with goroutines.

@gopherbot gopherbot added this to the Proposal milestone Sep 1, 2024
@seankhliao
Copy link
Member

making code behave differently in tests than in normal operation sounds like a source for confusion. Like many testing functionality like race detection and coverage, it should be opt in, like it is now with GODEBUG.

@ianlancetaylor
Copy link
Contributor

This would almost certainly break existing users who parse stack traces.

The information would be sometimes useful and sometimes not. Many servers can have hundreds or thousands of goroutines that all started at the same place, such as the server's call to Accept. Dumping the stack trace of the Accept call hundreds of times, even if only in a test, serves nobody.

Since we already have a way to do this, I'm going to close this proposal. Sorry.

@ianlancetaylor ianlancetaylor closed this as not planned Won't fix, can't repro, duplicate, stale Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants