Closed mhchia closed 5 years ago
SIGSEGV occurs when tracer is not Newed successfully and therefore closer == nil
SIGSEGV
tracer
New
closer == nil
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x16135cd] goroutine 1 [running]: main.runServer(0x17d3d9d, 0x9, 0x2710, 0x0, 0x0, 0x0, 0x0, 0xc4200b3e10, 0xf, 0xc4200b3e30, ...) /go/src/github.com/ethresearch/sharding-p2p-poc/main.go:160 +0x67d main.main() /go/src/github.com/ethresearch/sharding-p2p-poc/main.go:81 +0x5b0
Move defer closer.Close() to the else block
defer closer.Close()
else
What was wrong?
SIGSEGV
occurs whentracer
is notNew
ed successfully and thereforecloser == nil
How was it fixed?
Move
defer closer.Close()
to theelse
blockCute Animal Picture