From c5bccc5474f6ecc2f083c7e34e9ccb1be2de5312 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Sat, 13 May 2017 17:05:44 +0200 Subject: [PATCH] set missing logger on switch ``` panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x882cec] goroutine 328 [running]: github.com/tendermint/tendermint/p2p.(*Switch).DialPeerWithAddress(0xc42000a500, 0xc4202088d0, 0xc420403500, 0x0, 0x0, 0x0) /home/vagrant/go/src/github.com/tendermint/tendermint/p2p/switch.go:324 +0x2fc github.com/tendermint/tendermint/p2p.(*PEXReactor).ensurePeers.func1(0xc4201663f0, 0xc4202088d0) /home/vagrant/go/src/github.com/tendermint/tendermint/p2p/pex_reactor.go:280 +0x3e created by github.com/tendermint/tendermint/p2p.(*PEXReactor).ensurePeers /home/vagrant/go/src/github.com/tendermint/tendermint/p2p/pex_reactor.go:284 +0x5d4 ``` --- p2p/pex_reactor_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/p2p/pex_reactor_test.go b/p2p/pex_reactor_test.go index 76738c86..2ce131a0 100644 --- a/p2p/pex_reactor_test.go +++ b/p2p/pex_reactor_test.go @@ -75,6 +75,8 @@ func TestPEXReactorRunning(t *testing.T) { // create switches for i := 0; i < N; i++ { switches[i] = makeSwitch(config, i, "127.0.0.1", "123.123.123", func(i int, sw *Switch) *Switch { + sw.SetLogger(log.TestingLogger().With("switch", i)) + r := NewPEXReactor(book) r.SetLogger(log.TestingLogger()) r.SetEnsurePeersPeriod(250 * time.Millisecond)