From 987162f53d72bd19b4c5b026155ebf2b62a3df9b Mon Sep 17 00:00:00 2001 From: Yvonnick Esnault Date: Mon, 2 Jan 2023 09:57:26 +0100 Subject: [PATCH] fix(sdk): goroutine display stack (#6398) --- sdk/goroutine.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/goroutine.go b/sdk/goroutine.go index 5813d56747..0a40f11f64 100644 --- a/sdk/goroutine.go +++ b/sdk/goroutine.go @@ -143,7 +143,7 @@ func (m *GoRoutines) exec(g *GoRoutine) { defer func() { if r := recover(); r != nil { buf := make([]byte, 1<<16) - runtime.Stack(buf, false) + buf = buf[:runtime.Stack(buf, false)] ctx = context.WithValue(ctx, cdslog.Stacktrace, string(buf)) log.Error(ctx, "[PANIC][%s] %s failed", hostname, g.Name) }