Fix Go 1.24 http.Serve panic stack detection by adding newline after each bucket (#97)
Go 1.24 changed runtime.Stack() output format for http.Serve panic.
Previously first panic printed stack immediately. Now it requires
an additional LF character before detecting the stack.
Add a newline after each bucket/goroutine output to fix this.
Without this, the second+ panic's stack trace appears but the first
panic's stack trace is silently discarded.
Ref: https://github.com/maruel/panicparse/issues/93
diff --git a/internal/main.go b/internal/main.go
index c44bfd3..cb90667 100644
--- a/internal/main.go
+++ b/internal/main.go
@@ -79,6 +79,7 @@
}
_, _ = io.WriteString(out, header)
_, _ = io.WriteString(out, p.StackLines(&e.Signature, srcLen, pkgLen, pf))
+ _, _ = io.WriteString(out, "\n")
}
return nil
}
@@ -99,6 +100,7 @@
}
_, _ = io.WriteString(out, header)
_, _ = io.WriteString(out, p.StackLines(&e.Signature, srcLen, pkgLen, pf))
+ _, _ = io.WriteString(out, "\n")
}
return nil
}