diff --git a/prog/weave-npc/main.go b/prog/weave-npc/main.go index 79909a24fb..ba307bb5de 100644 --- a/prog/weave-npc/main.go +++ b/prog/weave-npc/main.go @@ -2,8 +2,10 @@ package main import ( "context" + "fmt" "os" "os/signal" + goruntime "runtime" "syscall" "github.com/coreos/go-iptables/iptables" @@ -218,7 +220,9 @@ func hCtx() context.Context { func stopOnPanicRecover() { if r := recover(); r != nil { - os.Exit(1) + buf := make([]byte, 1<<20) + stacklen := goruntime.Stack(buf, false) + handleFatal(fmt.Errorf("panic: %v \n%s", r, buf[:stacklen])) } }