Skip to content

Commit 86e1f0f

Browse files
committed
fix parsing go1.23 stack traces
fixes #90
1 parent 55d0809 commit 86e1f0f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

stack/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ var (
270270
// These are effectively constants.
271271
var (
272272
// gotRoutineHeader
273-
reRoutineHeader = regexp.MustCompile("^([ \t]*)goroutine (\\d+) \\[([^\\]]+)\\]\\:$")
273+
reRoutineHeader = regexp.MustCompile("^([ \t]*)goroutine (\\d+)(?: gp=[^ ]+ m=[^ ]+(?: mp=[^ ]+)?)? \\[([^\\]]+)\\]\\:$")
274274
reMinutes = regexp.MustCompile(`^(\d+) minutes$`)
275275

276276
// gotUnavail

stack/context_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,6 +1348,9 @@ func TestScanSnapshotSyntheticTwoSnapshots(t *testing.T) {
13481348
prefix := bytes.Buffer{}
13491349
s, suffix, err := ScanSnapshot(&in, &prefix, defaultOpts())
13501350
compareErr(t, nil, err)
1351+
if err != nil {
1352+
t.Fatal(err)
1353+
}
13511354
if !s.guessPaths() {
13521355
t.Error("expected success")
13531356
}
@@ -1523,6 +1526,9 @@ func TestGomoduleComplex(t *testing.T) {
15231526
prefix := bytes.Buffer{}
15241527
s, suffix, err := ScanSnapshot(bytes.NewReader(out), &prefix, defaultOpts())
15251528
compareErr(t, io.EOF, err)
1529+
if err != nil {
1530+
t.Fatal(err)
1531+
}
15261532
if !s.guessPaths() {
15271533
t.Error("expected success")
15281534
}

0 commit comments

Comments
 (0)