While I was testing lnmetrics plugin I found that there is some very bad case of crash while reading from the socket and this is the stackatrace
โ VincentSSD panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x6c2c8c]
goroutine 41 [running]:
github.com/vincenzopalazzo/cln4go/client.(*UnixRPC).decodeToResponse(0xc000631bb0, {0xc00419e000, 0x8ec0, 0xa000})
/home/vincent/Github/OpenLNMetrics/go-lnmetrics.reporter/vendor/github.com/vincenzopalazzo/cln4go/client/unix.go:51 +0xcc
github.com/vincenzopalazzo/cln4go/client.UnixRPC.Call({{0x805c28, 0xc000014270}, {0x0, 0x0}, {0x8045e0, 0xa1a568}}, {0x772b6c, 0x9}, 0xc00063c540)
/home/vincent/Github/OpenLNMetrics/go-lnmetrics.reporter/vendor/github.com/vincenzopalazzo/cln4go/client/unix.go:91 +0x2e9
github.com/vincenzopalazzo/cln4go/client.Call[...]({0x801200, 0xc000128360}, {0x772b6c, 0x9}, {0x4d5aa5})
/home/vincent/Github/OpenLNMetrics/go-lnmetrics.reporter/vendor/github.com/vincenzopalazzo/cln4go/client/client.go:14 +0x70
github.com/LNOpenMetrics/go-lnmetrics.reporter/pkg/ln.ListPeers({0x801200?, 0xc000128360?}, 0xc000629d50?)
/home/vincent/Github/OpenLNMetrics/go-lnmetrics.reporter/pkg/ln/client.go:85 +0x3f
github.com/LNOpenMetrics/go-lnmetrics.reporter/internal/plugin.(*MetricOne).snapshotListPeers(0xc0001301c0, {0x801200, 0xc000128360})
/home/vincent/Github/OpenLNMetrics/go-lnmetrics.reporter/internal/plugin/metrics_one.go:88 +0x7c
github.com/LNOpenMetrics/go-lnmetrics.reporter/internal/plugin.(*MetricOne).onEvent(0x803880?, {0x772680, 0x8}, {0x801200, 0xc000128360})
/home/vincent/Github/OpenLNMetrics/go-lnmetrics.reporter/internal/plugin/metrics_one.go:106 +0x59
github.com/LNOpenMetrics/go-lnmetrics.reporter/internal/plugin.(*MetricOne).OnInit(0xc0001301c0, {0x801200, 0xc000128360})
/home/vincent/Github/OpenLNMetrics/go-lnmetrics.reporter/internal/plugin/metrics_one.go:184 +0x27b
github.com/LNOpenMetrics/go-lnmetrics.reporter/internal/plugin.(*MetricsPlugin).RegisterOneTimeEvt.func1.1(0x9ea320, {0x805df8, 0xc0001301c0})
/home/vincent/Github/OpenLNMetrics/go-lnmetrics.reporter/internal/plugin/plugin.go:143 +0x3e
created by github.com/LNOpenMetrics/go-lnmetrics.reporter/internal/plugin.(*MetricsPlugin).RegisterOneTimeEvt.func1
/home/vincent/Github/OpenLNMetrics/go-lnmetrics.reporter/internal/plugin/plugin.go:142 +0xac