From 645a341b7d4210eece285c8dbe6e3e6cdbfbe35e Mon Sep 17 00:00:00 2001 From: David Symonds Date: Fri, 14 Feb 2014 10:15:38 +1100 Subject: [PATCH] net/http: increase panic stack trace buffer size from 4 KB to 64 KB. 4 KB is a bit too small in some situations (e.g. panic during a template execution), and ends up with an unhelpfully-truncated trace. 64 KB should be much more likely to capture the useful information. There's not a garbage generation issue, since this code should only be triggered when there's something seriously wrong with the program. LGTM=bradfitz R=bradfitz CC=golang-codereviews https://golang.org/cl/63520043 --- src/pkg/net/http/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pkg/net/http/server.go b/src/pkg/net/http/server.go index 77cbee1dee..fea1898fd7 100644 --- a/src/pkg/net/http/server.go +++ b/src/pkg/net/http/server.go @@ -1083,7 +1083,7 @@ func validNPN(proto string) bool { func (c *conn) serve() { defer func() { if err := recover(); err != nil { - const size = 4096 + const size = 64 << 10 buf := make([]byte, size) buf = buf[:runtime.Stack(buf, false)] log.Printf("http: panic serving %v: %v\n%s", c.remoteAddr, err, buf) -- 2.48.1