Skip to content

Segmentation fault | panic: runtime error: invalid memory address or nil pointer dereference #3823

@acoutts

Description

@acoutts

Background

I experienced a segmentation fault today and had to recycle lnd.

Your environment

  • lnd version 0.8.2-beta commit=v0.8.0-beta-426-g70c5fe3d0062bc2b0cca6de15388904e7232fc88
  • Linux 4.9.140-tegra #1 SMP PREEMPT Tue Nov 5 13:43:53 PST 2019 aarch64 aarch64 aarch64 GNU/Linux
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.3 LTS
Release:	18.04
Codename:	bionic
  • btcd version 0.20.1-beta

Steps to reproduce

Unknown - the crash happened while sitting idle (not interacting with lncli).

Expected behaviour

Should not be any seg faults.

Actual behaviour

lnd daemon crashed.

Here's the log from when the crash happened:

2019-12-11 18:50:53.712 [INF] NTFN: New block epoch subscription
2019-12-11 18:50:53.712 [INF] CNCT: Close observer for ChannelPoint(92acd089ab1af0385413d037c0a5aa73c8b4fda92d1cb8f114e62c2769f20736:1) active
2019-12-11 18:50:53.712 [INF] NTFN: New confirmation subscription: conf_id=1, txid=92acd089ab1af0385413d037c0a5aa73c8b4fda92d1cb8f114e62c2769f20736, num_confs=3 height_hint=607716
2019-12-11 18:50:53.712 [INF] FNDG: Waiting for funding tx (92acd089ab1af0385413d037c0a5aa73c8b4fda92d1cb8f114e62c2769f20736) to reach 3 confirmations
2019-12-11 18:51:47.871 [INF] CRTR: Processed channels=0 updates=40 nodes=0 in last 1m0.000815301s
2019-12-11 18:52:11.542 [INF] DISC: Broadcasting 40 new announcements in 4 sub batches
2019-12-11 18:52:17.905 [ERR] BTCN: Can't accept connection: unable to accept connection from 92.53.65.101:55554: EOF
2019-12-11 18:52:19.221 [INF] SRVR: New inbound connection from 92.53.65.101:55590
2019-12-11 18:52:19.222 [INF] SRVR: Finalizing connection to 0218599c7f8c0b7b4d97f8f2cb09cb0666e9c28aa063aac883db967265092ae3b8@92.53.65.101:55590, inbound=true
2019-12-11 18:52:19.222 [INF] SRVR: Negotiated chan series queries with 0218599c7f8c0b7b4d97f8f2cb09cb0666e9c28aa063aac883db967265092ae3b8
2019-12-11 18:52:19.222 [INF] DISC: Creating new GossipSyncer for peer=0218599c7f8c0b7b4d97f8f2cb09cb0666e9c28aa063aac883db967265092ae3b8
2019-12-11 18:52:19.363 [INF] DISC: GossipSyncer(0218599c7f8c0b7b4d97f8f2cb09cb0666e9c28aa063aac883db967265092ae3b8): filtering chan range: start_height=607567, num_blocks=4294359728
2019-12-11 18:52:19.364 [INF] DISC: GossipSyncer(0218599c7f8c0b7b4d97f8f2cb09cb0666e9c28aa063aac883db967265092ae3b8): sending final chan range chunk, size=108
2019-12-11 18:52:19.517 [INF] DISC: GossipSyncer(0218599c7f8c0b7b4d97f8f2cb09cb0666e9c28aa063aac883db967265092ae3b8): fetching chan anns for 67 chans
2019-12-11 18:52:21.964 [INF] PEER: unable to read message from 0218599c7f8c0b7b4d97f8f2cb09cb0666e9c28aa063aac883db967265092ae3b8@92.53.65.101:55590: EOF
2019-12-11 18:52:21.966 [INF] PEER: Disconnecting 0218599c7f8c0b7b4d97f8f2cb09cb0666e9c28aa063aac883db967265092ae3b8@92.53.65.101:55590, reason: read handler closed
2019-12-11 18:52:22.069 [INF] DISC: Removing GossipSyncer for peer=0218599c7f8c0b7b4d97f8f2cb09cb0666e9c28aa063aac883db967265092ae3b8
2019-12-11 18:52:47.870 [INF] CRTR: Processed channels=0 updates=47 nodes=0 in last 59.997744992s
2019-12-11 18:53:41.543 [INF] DISC: Broadcasting 66 new announcements in 7 sub batches
2019-12-11 18:53:47.871 [INF] CRTR: Processed channels=0 updates=19 nodes=0 in last 1m0.000168982s
2019-12-11 18:54:47.872 [INF] CRTR: Processed channels=0 updates=28 nodes=2 in last 1m0.000404391s
2019-12-11 18:55:11.543 [INF] DISC: Broadcasting 33 new announcements in 4 sub batches
2019-12-11 18:55:16.712 [INF] INVC: New invoice subscription client: id=1
2019-12-11 18:55:17.693 [ERR] BTCN: Can't accept connection: unable to accept connection from 92.53.65.101:39032: EOF
2019-12-11 18:55:24.007 [INF] SRVR: New inbound connection from 92.53.65.101:39392
2019-12-11 18:55:24.007 [INF] SRVR: Finalizing connection to 0218599c7f8c0b7b4d97f8f2cb09cb0666e9c28aa063aac883db967265092ae3b8@92.53.65.101:39392, inbound=true
2019-12-11 18:55:24.008 [INF] SRVR: Negotiated chan series queries with 0218599c7f8c0b7b4d97f8f2cb09cb0666e9c28aa063aac883db967265092ae3b8
2019-12-11 18:55:24.008 [INF] DISC: Creating new GossipSyncer for peer=0218599c7f8c0b7b4d97f8f2cb09cb0666e9c28aa063aac883db967265092ae3b8
2019-12-11 18:55:24.145 [INF] DISC: GossipSyncer(0218599c7f8c0b7b4d97f8f2cb09cb0666e9c28aa063aac883db967265092ae3b8): filtering chan range: start_height=607567, num_blocks=4294359728
2019-12-11 18:55:24.147 [INF] DISC: GossipSyncer(0218599c7f8c0b7b4d97f8f2cb09cb0666e9c28aa063aac883db967265092ae3b8): sending final chan range chunk, size=108
2019-12-11 18:55:24.286 [INF] DISC: GossipSyncer(0218599c7f8c0b7b4d97f8f2cb09cb0666e9c28aa063aac883db967265092ae3b8): fetching chan anns for 67 chans
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x525a48]

goroutine 18062 [running]:
github.com/lightningnetwork/lnd/lnwire.(*FeatureVector).Features(0x0, 0x4)
	/media/ext/bitcoinhome/lnd/source/lnwire/features.go:393 +0x20
github.com/lightningnetwork/lnd.(*rpcServer).DecodePayReq(0x40000d7960, 0x1072e40, 0x4002acb500, 0x4002acb590, 0x40000d7960, 0x40046f72b8, 0x40033e7838)
	/media/ext/bitcoinhome/lnd/source/rpcserver.go:4633 +0x224
github.com/lightningnetwork/lnd/lnrpc._Lightning_DecodePayReq_Handler.func1(0x1072e40, 0x4002acb500, 0xc80d40, 0x4002acb590, 0x4001e6d830, 0x0, 0x0, 0x8)
	/media/ext/bitcoinhome/lnd/source/lnrpc/rpc.pb.go:12529 +0x7c
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1(0x1072e40, 0x4002acb500, 0xc80d40, 0x4002acb590, 0x4001e6d830, 0xcd72c0, 0x400008cc01, 0x400355ad00)
	/home/xff0c/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.0.0/chain.go:31 +0xf8
github.com/lightningnetwork/lnd.errorLogUnaryServerInterceptor.func1(0x1072e40, 0x4002acb500, 0xc80d40, 0x4002acb590, 0x4003c9f960, 0x40004ee4b0, 0x40002fe050, 0x4003c9f9c0, 0x40039343a0, 0x400008cc00)
	/media/ext/bitcoinhome/lnd/source/log.go:150 +0x58
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1(0x1072e40, 0x4002acb500, 0xc80d40, 0x4002acb590, 0x1, 0x1, 0x0, 0x0)
	/home/xff0c/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.0.0/chain.go:34 +0x90
github.com/lightningnetwork/lnd/macaroons.(*Service).UnaryServerInterceptor.func1(0x1072e40, 0x4002acb500, 0xc80d40, 0x4002acb590, 0x4003c9f960, 0x40004ee4b0, 0x0, 0x40043ad600, 0x4000d849d8, 0x89d264)
	/media/ext/bitcoinhome/lnd/source/macaroons/service.go:124 +0x110
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1(0x1072e40, 0x4002acb500, 0xc80d40, 0x4002acb590, 0x4003c9f960, 0x4003c9f980, 0xc6a060, 0x4002acb500, 0x50, 0xc95b00)
	/home/xff0c/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-middleware@v1.0.0/chain.go:39 +0x138
github.com/lightningnetwork/lnd/lnrpc._Lightning_DecodePayReq_Handler(0xd30440, 0x40000d7960, 0x1072e40, 0x4002acb500, 0x40027d9f90, 0x40005ecea0, 0x1072e40, 0x4002acb500, 0x4000585440, 0x228)
	/media/ext/bitcoinhome/lnd/source/lnrpc/rpc.pb.go:12531 +0x128
google.golang.org/grpc.(*Server).processUnaryRPC(0x400050b680, 0x1082220, 0x400276f500, 0x40043ad600, 0x40005ecff0, 0x1959f60, 0x0, 0x0, 0x0)
	/home/xff0c/go/pkg/mod/google.golang.org/grpc@v1.19.0/server.go:971 +0x38c
google.golang.org/grpc.(*Server).handleStream(0x400050b680, 0x1082220, 0x400276f500, 0x40043ad600, 0x0)
	/home/xff0c/go/pkg/mod/google.golang.org/grpc@v1.19.0/server.go:1250 +0xaec
google.golang.org/grpc.(*Server).serveStreams.func1.1(0x40043e7740, 0x400050b680, 0x1082220, 0x400276f500, 0x40043ad600)
	/home/xff0c/go/pkg/mod/google.golang.org/grpc@v1.19.0/server.go:690 +0x94
created by google.golang.org/grpc.(*Server).serveStreams.func1
	/home/xff0c/go/pkg/mod/google.golang.org/grpc@v1.19.0/server.go:688 +0x8c

Metadata

Metadata

Assignees

Labels

bugUnintended code behaviourpaymentsRelated to invoices/paymentsrpcRelated to the RPC interface

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions