From ba4d6451635181d96a424d9a2644db4dba17084c Mon Sep 17 00:00:00 2001 From: Nafeez Date: Mon, 16 May 2022 12:37:21 -0700 Subject: [PATCH] Add debug.SetTraceback for runsc-gofer The -traceback flag sets the Debug.SetTraceback for runsc-sandbox. We need this for gofer too. Fixes #7583 --- runsc/cmd/gofer.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runsc/cmd/gofer.go b/runsc/cmd/gofer.go index c65e0267a..e1c414f25 100644 --- a/runsc/cmd/gofer.go +++ b/runsc/cmd/gofer.go @@ -20,6 +20,7 @@ import ( "fmt" "os" "path/filepath" + "runtime/debug" "strings" "github.com/google/subcommands" @@ -99,6 +100,9 @@ func (g *Gofer) Execute(_ context.Context, f *flag.FlagSet, args ...interface{}) conf := args[0].(*config.Config) + // Set traceback level + debug.SetTraceback(conf.Traceback) + specFile := os.NewFile(uintptr(g.specFD), "spec file") defer specFile.Close() spec, err := specutils.ReadSpecFromFile(g.bundleDir, specFile, conf)