diff --git a/beacon-chain/powchain/service.go b/beacon-chain/powchain/service.go index 999fae263..121262710 100644 --- a/beacon-chain/powchain/service.go +++ b/beacon-chain/powchain/service.go @@ -6,6 +6,7 @@ import ( "errors" "fmt" "math/big" + "runtime/debug" "strings" "time" @@ -268,6 +269,8 @@ func safelyHandlePanic() { log.WithFields(logrus.Fields{ "r": r, }).Error("Panicked when handling data from ETH 1.0 Chain! Recovering...") + + debug.PrintStack() } } diff --git a/beacon-chain/sync/initial-sync/service.go b/beacon-chain/sync/initial-sync/service.go index 9ce504fb7..ab89552b8 100644 --- a/beacon-chain/sync/initial-sync/service.go +++ b/beacon-chain/sync/initial-sync/service.go @@ -14,6 +14,7 @@ import ( "context" "errors" "fmt" + "runtime/debug" "strings" "sync" "time" @@ -250,6 +251,8 @@ func safelyHandleMessage(fn func(p2p.Message), msg p2p.Message) { "msg": printedMsg, }).Error("Panicked when handling p2p message! Recovering...") + debug.PrintStack() + if msg.Ctx == nil { return } diff --git a/beacon-chain/sync/regular_sync.go b/beacon-chain/sync/regular_sync.go index 104e2fd7c..fda70d85d 100644 --- a/beacon-chain/sync/regular_sync.go +++ b/beacon-chain/sync/regular_sync.go @@ -4,6 +4,7 @@ package sync import ( "context" "fmt" + "runtime/debug" "github.com/gogo/protobuf/proto" "github.com/prometheus/client_golang/prometheus" @@ -241,6 +242,8 @@ func safelyHandleMessage(fn func(p2p.Message), msg p2p.Message) { "msg": printedMsg, }).Error("Panicked when handling p2p message! Recovering...") + debug.PrintStack() + if msg.Ctx == nil { return } diff --git a/shared/messagehandler/messagehandler.go b/shared/messagehandler/messagehandler.go index 833bec107..90ceeb9d0 100644 --- a/shared/messagehandler/messagehandler.go +++ b/shared/messagehandler/messagehandler.go @@ -3,6 +3,7 @@ package messagehandler import ( "context" "fmt" + "runtime/debug" "github.com/gogo/protobuf/proto" "github.com/sirupsen/logrus" @@ -25,6 +26,8 @@ func SafelyHandleMessage(ctx context.Context, fn func(ctx context.Context, messa "msg": printedMsg, }).Error("Panicked when handling p2p message! Recovering...") + debug.PrintStack() + if ctx == nil { return }