lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.73k stars 2.09k forks source link

panic: runtime error: invalid memory address or nil pointer dereference #1795

Closed robtex closed 6 years ago

robtex commented 6 years ago

lnd version 0.4.2-beta commit=26f68da5b2883885fcf6a8e79b3fc9bb12cc9eef


2018-08-27 10:36:36.067 [INF] DISC: gossipSyncer(02510b96fb0f56fe304ea8e85c7929a8217da0e3d28d8139dd2b423d8928342177): requesting new chans from height=538555 and 4294428740 blocks after
2018-08-27 10:36:36.054 [WRN] DISC: unable to apply gossip filter for peer=02f8d581eb20cf0bd2fc515a99555e59f94e98b20c1248abbc6af13bd3c0df83a3: edge not found                                                             2018-08-27 10:36:36.032 [INF] HSWC: HTLC manager for ChannelPoint(71483c16415583ee657b1dc22a11cc2e0baf0407b5b28837069c7978cdf71cca:0) started, bandwidth=4039960 mSAT
2018-08-27 10:36:36.068 [INF] HSWC: Attempting to re-resynchronize ChannelPoint(71483c16415583ee657b1dc22a11cc2e0baf0407b5b28837069c7978cdf71cca:0)
2018-08-27 10:36:36.068 [INF] HSWC: Received re-establishment message from remote side for channel(33a87659093747aa4a66afc0b86db90936b6f195c13a369f27f876688e40540c:0)
2018-08-27 10:36:36.068 [INF] HSWC: ChannelLink(f9e4cb9921ff9d1000cac6ec7d2f7d161dce24be9b60883017a8d0967878f881:1) is starting
2018-08-27 10:36:36.033 [INF] CNCT: Attempting to update ContractSignals for ChannelPoint(71483c16415583ee657b1dc22a11cc2e0baf0407b5b28837069c7978cdf71cca:0)
2018-08-27 10:36:36.069 [TRC] CNCT: ChannelArbitrator(71483c16415583ee657b1dc22a11cc2e0baf0407b5b28837069c7978cdf71cca:0) got new signal update!
2018-08-27 10:36:36.069 [ERR] DISC: unable to reply to peer query: unknown message: *lnwire.ReplyShortChanIDsEnd
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x48 pc=0x97a83d]

goroutine 6788 [running]:
github.com/lightningnetwork/lnd/lnwallet.(*LightningChannel).logUpdateToPayDesc(0xc4245d2900, 0xc42fbcb0b0, 0xc42efdf1a0, 0x8, 0x4e2, 0xc4269d8a80, 0x1554, 0xc42fbcaf18, 0x1, 0xc422a6f220)
        /home/robban/gocode/src/github.com/lightningnetwork/lnd/lnwallet/channel.go:1574 +0x55d
github.com/lightningnetwork/lnd/lnwallet.(*LightningChannel).restoreStateLogs(0xc4245d2900, 0xc4242b9ec0, 0xc432b50000, 0xc432b500c0, 0xc43472c700, 0xc4269d8a80, 0x0, 0x0)
        /home/robban/gocode/src/github.com/lightningnetwork/lnd/lnwallet/channel.go:1811 +0x813
github.com/lightningnetwork/lnd/lnwallet.(*LightningChannel).restoreCommitState(0xc4245d2900, 0xc42fbcbce0, 0xc42fbcbc60, 0x1109d10, 0x0)
        /home/robban/gocode/src/github.com/lightningnetwork/lnd/lnwallet/channel.go:1707 +0x49d
github.com/lightningnetwork/lnd/lnwallet.NewLightningChannel(0x11aa360, 0xc42008b1a0, 0x7f18aa74fec8, 0xc4200c0a40, 0xc429ae1500, 0x1, 0xdf79c58e340498, 0xc42419adf0)
        /home/robban/gocode/src/github.com/lightningnetwork/lnd/lnwallet/channel.go:1400 +0x6a3
main.newServer.func18(0xebf0b3626a68ff32, 0xbd5687d8db68df8f, 0xfb27837cc1300ee4, 0x10eae18d682cba42, 0x0, 0x2, 0x0)
        /home/robban/gocode/src/github.com/lightningnetwork/lnd/server.go:756 +0x154
main.(*fundingManager).handleFundingLocked(0xc4202b5200, 0xc42987e7c0)
        /home/robban/gocode/src/github.com/lightningnetwork/lnd/fundingmanager.go:2317 +0x451
created by main.(*fundingManager).reservationCoordinator
        /home/robban/gocode/src/github.com/lightningnetwork/lnd/fundingmanager.go:892 +0x4f3
halseth commented 6 years ago

@robtex Do you have more logs prior to the crash? It would help determining what is trying to be restored.

robtex commented 6 years ago

Sorry no, can't keep logs until the fetching chan anns for 1 chans is fixed. had to delete all logs this morning since the log partition was full.

wpaulino commented 6 years ago

@Xian001, your panic is due to a different issue. The fix for it is being tracked in https://github.com/btcsuite/btcwallet/pull/540. Once that's merged, we'll need to update the btcwallet dependency on the lnd side.

halseth commented 6 years ago

Please update this if seen on v0.5+.

Liongrass commented 6 years ago

I'm seeing this issue after I updated to LND 0.5 Have a look at the output below. I upgraded to LND 0.5 and could connect ZAP well. Then I opened a channel, and from then everytime I would connect ZAP, LND would immediately crash.


2018-09-18 22:30:59.509 [INF] RPCS: [listchannels] fetched 14 channels from DB
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xcf2a5d]

goroutine 14511 [running]:
main.(*rpcServer).GetTransactions(0xc0001ea870, 0x120ef00, 0xc010ffe120, 0x1a34638, 0xc0001ea870, 0xc0107dc380, 0xc0002a37a0)
    /home/loysan/go/src/github.com/lightningnetwork/lnd/rpcserver.go:3021 +0x20d
github.com/lightningnetwork/lnd/lnrpc._Lightning_GetTransactions_Handler.func1(0x120ef00, 0xc010ffe120, 0xe98c20, 0x1a34638, 0x1, 0x1, 0x0, 0x0)
    /home/loysan/go/src/github.com/lightningnetwork/lnd/lnrpc/rpc.pb.go:6271 +0x89
github.com/lightningnetwork/lnd/macaroons.(*Service).UnaryServerInterceptor.func1(0x120ef00, 0xc010ffe120, 0xe98c20, 0x1a34638, 0xc0107dc360, 0xc0107dc380, 0xc012c7ab50, 0x40e368, 0x50, 0xf3c6e0)
    /home/loysan/go/src/github.com/lightningnetwork/lnd/macaroons/service.go:126 +0x153
github.com/lightningnetwork/lnd/lnrpc._Lightning_GetTransactions_Handler(0xf94700, 0xc0001ea870, 0x120ef00, 0xc010ffe120, 0xc0113f2140, 0xc0108544c0, 0x0, 0x0, 0x0, 0x0)
    /home/loysan/go/src/github.com/lightningnetwork/lnd/lnrpc/rpc.pb.go:6273 +0x158
github.com/lightningnetwork/lnd/vendor/google.golang.org/grpc.(*Server).processUnaryRPC(0xc000488000, 0x12145e0, 0xc010bbc180, 0xc0002d6d00, 0xc0001ea9f0, 0x19f2490, 0xc010ffe180, 0x0, 0x0)
    /home/loysan/go/src/github.com/lightningnetwork/lnd/vendor/google.golang.org/grpc/server.go:781 +0x8ec
github.com/lightningnetwork/lnd/vendor/google.golang.org/grpc.(*Server).handleStream(0xc000488000, 0x12145e0, 0xc010bbc180, 0xc0002d6d00, 0xc010ffe180)
    /home/loysan/go/src/github.com/lightningnetwork/lnd/vendor/google.golang.org/grpc/server.go:981 +0x1308
github.com/lightningnetwork/lnd/vendor/google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc012439840, 0xc000488000, 0x12145e0, 0xc010bbc180, 0xc0002d6d00)
    /home/loysan/go/src/github.com/lightningnetwork/lnd/vendor/google.golang.org/grpc/server.go:551 +0x9f
created by github.com/lightningnetwork/lnd/vendor/google.golang.org/grpc.(*Server).serveStreams.func1
    /home/loysan/go/src/github.com/lightningnetwork/lnd/vendor/google.golang.org/grpc/server.go:549 +0xa1```
halseth commented 6 years ago

@Liongrass Looks like you are running into #1915, which is fixed in latest master :)

Roasbeef commented 6 years ago

Fixed by #1905.