-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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/debug: add SetCrashOutput options #67182
Comments
@adonovan I tried to implement the solution by adding the variadic parameter However, after running the
I suppose that the reason is the following line: var setCrashOutput func(*os.File) error // = runtime.SetCrashOutput on go1.23+ For this reason, I opened these 2 pull requests #67192 golang/telemetry#8 What do you think? |
Change https://go.dev/cl/583300 mentions this issue: |
Change https://go.dev/cl/583278 mentions this issue: |
Good point. Then perhaps we should just preemptively change x/telemetry to typeswitch on SetCrashOutput and do the right thing for both types. |
Marked as release blocker to ensure we make a decision before the release. |
Other uses we discussed for the options struct:
|
@prattmic I milestoned this for 1.23, rather than Proposal, since I think that affects tooling that searches for 1.23 release blockers. Please correct me if that's wrong. @matloob please note that this will require re-vendoring x/telemetry. In fact, this will be tricky or impossible to land without breaking one of the builds. |
Tricky but not impossible. The plan agreed above is:
|
@findleyr More specifically, what about the following?
Thoughts? |
Aha, thanks. @adonovan sorry for missing this consideration in the top comment. That plan sounds feasible. @Stavrospanakakis sure, that seems about right. I'll defer to @adonovan for coordinating these changes if/when the proposal is approved. |
Based on the discussion above, this proposal seems like a likely accept. The proposal is to change the recently added
to be
for future extensibility. We expect that there will be a |
No change in consensus, so accepted. 🎉 The proposal is to change the recently added
to be
for future extensibility. We expect that there will be a |
Change https://go.dev/cl/585378 mentions this issue: |
The function is about to get a second parameter. This shim will be removed later this week. Updates golang/go#67182 Change-Id: I166adda831979b713d429504b57510506bfdff11 Reviewed-on: https://go-review.googlesource.com/c/telemetry/+/585378 Reviewed-by: Michael Matloob <matloob@golang.org> Auto-Submit: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Change https://go.dev/cl/585557 mentions this issue: |
Change https://go.dev/cl/585835 mentions this issue: |
Updates golang/go#67182 Change-Id: I63e115eabb0e6780942add3e60c9a3cb147371be Reviewed-on: https://go-review.googlesource.com/c/tools/+/585835 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Alan Donovan <adonovan@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
Change https://go.dev/cl/585818 mentions this issue: |
This is a placeholder for future options (e.g. JSON). The parameter is temporarily variadic to avoid breaking x/telemetry (see CL 585378), but I plan to remove the "..." later this week. Updates #67182 Change-Id: I3f6f39455d852f92902f8e3f007d3093cbe555db Reviewed-on: https://go-review.googlesource.com/c/go/+/585557 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Austin Clements <austin@google.com>
Change https://go.dev/cl/585478 mentions this issue: |
Updates #67182 Change-Id: I14f6a35491e3a58fff2f33285bd13ac706668df6 Reviewed-on: https://go-review.googlesource.com/c/go/+/585818 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Austin Clements <austin@google.com>
Now that CL 585557 has landed in runtime/debug, we can supply the options. But we cannot eta-reduce the func literal because we don't want setCrashOutput's type to mention debug.CrashOptions, which is a go1.23-only type. Updates golang/go#67182 Change-Id: I2c3b5cbc4594b6bcd5b5ff43c933d0609cc1c309 Reviewed-on: https://go-review.googlesource.com/c/telemetry/+/585478 Reviewed-by: Michael Matloob <matloob@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Change https://go.dev/cl/585819 mentions this issue: |
Change https://go.dev/cl/585420 mentions this issue: |
Change https://go.dev/cl/585821 mentions this issue: |
Updates golang/go#67182 Change-Id: If9a225a0058c4c837b90238f993ac0d68783ca3a Reviewed-on: https://go-review.googlesource.com/c/tools/+/585821 Auto-Submit: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Matloob <matloob@golang.org>
Updates #67182 Change-Id: I76b312ccbd1ea98eb2f4e3beec9e8b42e633ea5b Reviewed-on: https://go-review.googlesource.com/c/go/+/585819 Auto-Submit: Alan Donovan <adonovan@google.com> Reviewed-by: Austin Clements <austin@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Updates #67182 Change-Id: I33fc8c515f4a9d120262ba30f61aea80ede5e9f8 Reviewed-on: https://go-review.googlesource.com/c/go/+/585420 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Austin Clements <austin@google.com>
This is now complete. Please be sure to use tip GOROOT when building tip x/tools or x/telemetry. |
The function is about to get a second parameter. This shim will be removed later this week. Updates golang/go#67182 Change-Id: I166adda831979b713d429504b57510506bfdff11 Reviewed-on: https://go-review.googlesource.com/c/telemetry/+/585378 Reviewed-by: Michael Matloob <matloob@golang.org> Auto-Submit: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Now that CL 585557 has landed in runtime/debug, we can supply the options. But we cannot eta-reduce the func literal because we don't want setCrashOutput's type to mention debug.CrashOptions, which is a go1.23-only type. Updates golang/go#67182 Change-Id: I2c3b5cbc4594b6bcd5b5ff43c933d0609cc1c309 Reviewed-on: https://go-review.googlesource.com/c/telemetry/+/585478 Reviewed-by: Michael Matloob <matloob@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
The debug.SetCrashOutput function was added for go1.23, but has not yet been released. After discussion with @aclements, we agree that support for JSON-formatted crash output containing all the information of runtime.CallersFrames is a desirable feature, since it frees the consumer of the crash from having to be a process of the same executable as the producer of the crash (in order to make sense of the PCs), and from having to think about relative address mappings--and no doubt for other reasons as well.
We propose to change the signature of SetCrashOutput so that it has a second parameter of type CrashOptions, which is defined as an initially empty struct. (We expect to add
JSON bool
in future, but neither of has time to implement it before the go1.23 freeze.)This change may break clients that depend on unreleased go1.23 features, such as x/telemetry. As a tactical matter, I suggest we add a variadic parameter
...CrashOptions
, update x/telemetry, and then remove the...
, all within a few hours. [Edit: doesn't work; clients will need to use typeswitch during the transition.]The text was updated successfully, but these errors were encountered: