Skip to content

Commit 987162f

Browse files
authored
fix(sdk): goroutine display stack (#6398)
1 parent 1846ecd commit 987162f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sdk/goroutine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func (m *GoRoutines) exec(g *GoRoutine) {
143143
defer func() {
144144
if r := recover(); r != nil {
145145
buf := make([]byte, 1<<16)
146-
runtime.Stack(buf, false)
146+
buf = buf[:runtime.Stack(buf, false)]
147147
ctx = context.WithValue(ctx, cdslog.Stacktrace, string(buf))
148148
log.Error(ctx, "[PANIC][%s] %s failed", hostname, g.Name)
149149
}

0 commit comments

Comments
 (0)