Skip to content

Commit

Permalink
internal/crashmonitor: clarify pre-go1.23 behavior
Browse files Browse the repository at this point in the history
The current comment implies that traceback includes PCs for inlined
frames in 1.23, which is not the case.

For golang/go#70637.

Change-Id: I26fe4328843733d230e31ccdb452d4a25ae91b3c
Reviewed-on: https://go-review.googlesource.com/c/telemetry/+/637756
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
  • Loading branch information
prattmic committed Dec 20, 2024
1 parent 738f4b2 commit 773b2e3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/crashmonitor/monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,13 @@ func TestViaStderr(t *testing.T) {
"runtime.goexit:--"

if !crashmonitor.Supported() { // !go1.23
// Before go1.23, the traceback excluded PCs for inlined frames.
// Traceback excludes PCs for inlined frames. Before go1.23
// (https://go.dev/cl/571798 specifically), passing the set of
// PCs in the traceback to runtime.CallersFrames, would report
// only the innermost inlined frame and none of the inline
// "callers".
//
// Thus, here we must drop the caller of the inlined frame.
want = strings.ReplaceAll(want, "golang.org/x/telemetry/internal/crashmonitor_test.child:+2\n", "")
}

Expand Down

0 comments on commit 773b2e3

Please sign in to comment.