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 https://github.com/golang/go/issues/69590#issuecomment-2578362721, 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

Comment From: gabyhelp

Related Issues

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