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

runtime: GODEBUG=profstackdepth=N not usable with //go:debug #71187

Open
prattmic opened this issue Jan 8, 2025 · 1 comment
Open

runtime: GODEBUG=profstackdepth=N not usable with //go:debug #71187

prattmic opened this issue Jan 8, 2025 · 1 comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@prattmic
Copy link
Member

prattmic commented Jan 8, 2025

Go 1.23 increased the default profiling stack depth from 32 to 128 (https://go.dev/cl/572396). It also introduced GODEBUG=profstackdepth=32 as a way to revert back to the old default (https://go.dev/cl/581917).

However, that new GODEBUG doesn't appear in the internal/godebugs table, which means it is not eligible for use in go.mod godebug blocks or //go:debug directives (https://go.dev/doc/godebug).

Given that the main purpose of this GODEBUG is for compatibility, it seems like it should be eligible for use there, and perhaps this should be backported to 1.23.

This came up in #69590 (comment), where a user would like the old behavior.

One thing that is a bit unclear to me: I think if we add this as an "official" compatibility GODEBUG, then we will tie it to the version in go.mod. i.e., modules with go 1.22.0 will use profstackdepth=32, even if built with 1.23. They must set go 1.23.0 to get the new behavior. That is probably the right thing to do, but might be a bit odd to change in a minor release.

cc @felixge @golang/runtime

@prattmic prattmic added NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. compiler/runtime Issues related to the Go compiler and/or runtime. labels Jan 8, 2025
@prattmic prattmic added this to the Go1.25 milestone Jan 8, 2025
@gabyhelp
Copy link

gabyhelp commented Jan 8, 2025

Related Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
Development

No branches or pull requests

2 participants