koinos / koinos-p2p

The p2p microservice orchestrates the distribution of blocks and transactions between peers.
MIT License
6 stars 4 forks source link

[BUG]: segmentation violation getting message for topic koinos.blocks #264

Closed aaron-ic closed 1 year ago

aaron-ic commented 1 year ago

Is there an existing issue for this?

Current behavior

Log messages prior to exit:

koinos-p2p-1  | 2022-10-23 08:37:05.043800 (p2p.Koinos) [p2p/gossip.go:399] <info>: Gossiped transaction applied - ID: 0x1220459d5f6ae824600fc295c85bacbf6ccd4b331f153161568c8ec345659f481dd2 from peer QmdrdcEnYDLgJUZzrhYNhYvEifBhiiTn7bndmnJUTma7dB
koinos-p2p-1  | 2022-10-23 08:37:05.058532 (p2p.Koinos) [p2p/gossip.go:399] <info>: Gossiped transaction applied - ID: 0x1220e640ec8463955c6ab939760a0a99793b386c7027241783cc83302a628e75bf4c from peer QmdrdcEnYDLgJUZzrhYNhYvEifBhiiTn7bndmnJUTma7dB
koinos-p2p-1  | 2022-10-23 08:37:05.060781 (p2p.Koinos) [p2p/gossip.go:227] <info>: Publishing transaction - ID: 0x1220e640ec8463955c6ab939760a0a99793b386c7027241783cc83302a628e75bf4c
koinos-p2p-1  | 2022-10-23 08:37:05.065724 (p2p.Koinos) [p2p/gossip.go:399] <info>: Gossiped transaction applied - ID: 0x122028ebe6bcf2de7dfceb4139b5934f155f0bfba473cd7e9e27c53906d5b85e033e from peer QmdrdcEnYDLgJUZzrhYNhYvEifBhiiTn7bndmnJUTma7dB
koinos-p2p-1  | 2022-10-23 08:37:05.072146 (p2p.Koinos) [p2p/gossip.go:211] <info>: Stopping gossip mode
koinos-p2p-1  | 2022-10-23 08:37:05.072445 (p2p.Koinos) [p2p/gossip.go:132] <warn>: Error getting message for topic koinos.blocks: context canceled
koinos-p2p-1  | 2022-10-23 08:37:05.072380 (p2p.Koinos) [p2p/gossip.go:227] <info>: Publishing transaction - ID: 0x12205ab3f47d99f06484b43f9812019b36e890ecce7810ecb3aaebb883ad2ea3fdb7
koinos-p2p-1  | 2022-10-23 08:37:05.072177 (p2p.Koinos) [p2p/gossip.go:399] <info>: Gossiped transaction applied - ID: 0x12205ab3f47d99f06484b43f9812019b36e890ecce7810ecb3aaebb883ad2ea3fdb7 from peer QmdrdcEnYDLgJUZzrhYNhYvEifBhiiTn7bndmnJUTma7dB
koinos-p2p-1  | panic: runtime error: invalid memory address or nil pointer dereference
koinos-p2p-1  | [signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xa8cb2d]
koinos-p2p-1  | 
koinos-p2p-1  | goroutine 527921 [running]:
koinos-p2p-1  | github.com/libp2p/go-libp2p-pubsub.(*Subscription).Next(0x0, {0x154b368, 0xc00f606040})
koinos-p2p-1  |         /go/pkg/mod/github.com/libp2p/go-libp2p-pubsub@v0.7.1/subscription.go:27 +0x2d
koinos-p2p-1  | github.com/koinos/koinos-p2p/internal/p2p.(*GossipManager).readMessages(0xc0004683c0, {0x154b368, 0xc00f606040}, 0xc00d574000)
koinos-p2p-1  |         /koinos-p2p/internal/p2p/gossip.go:130 +0x6c
koinos-p2p-1  | created by github.com/koinos/koinos-p2p/internal/p2p.(*GossipManager).Start
koinos-p2p-1  |         /koinos-p2p/internal/p2p/gossip.go:88 +0x1fb
koinos-p2p-1 exited with code 2

block_producer.log around the same timeframe. Nothing of interest in other microservice logs.

Expected behavior

p2p container does not terminate prematurely

Steps to reproduce

No response

Environment

- OS: ArchLinux
- Docker version 20.10.16, build aa7e414fdc
- p2p image 5891c001a1cf (latest)

Anything else?

No response

mvandeberg commented 1 year ago

p2p latest (at the time of writing) is:

koinos/koinos-p2p           latest         0a5b97fdce9e   2 days ago       44.2M

We believe this bug was fixed in #261

When updating to use latest be sure to run docker system prune -a --volumes. If you already have an image tagged latest. Docker will not go check for a newer latest.

aaron-ic commented 1 year ago

Right you are @mvandeberg! I didn't consider that I could have an out-of-date image after only a couple of days :D You guys are owning these bugs.