ledgerwatch / erigon

Ethereum implementation on the efficiency frontier
GNU Lesser General Public License v3.0
3.03k stars 1.06k forks source link

dl: sepolia no peer panic #10972

Closed AskAlexSharov closed 1 day ago

AskAlexSharov commented 3 days ago

sepolia, main

panic: no active peers, but 1 conns with all
    panic: no active peers, but 1 conns with all

goroutine 12274368 [running]:
github.com/anacrolix/torrent.(*Torrent).deletePeerConn(0xc0434bb808, 0xc0b8198a88, 0x1, 0x1)
    github.com/anacrolix/torrent@v1.52.6-0.20231201115409-7ea994b6bbd8/torrent.go:1936 +0x234
github.com/anacrolix/torrent.(*Torrent).dropConnection(0xc0434bb808, 0xc0b8198a88, 0x1, 0x1)
    github.com/anacrolix/torrent@v1.52.6-0.20231201115409-7ea994b6bbd8/torrent.go:1983 +0x65
panic({0x2437a40?, 0xc0a30585c0?})
    runtime/panic.go:770 +0x132
github.com/anacrolix/torrent.(*Torrent).deletePeerConn(0xc0434bb808, 0xc0b8198a88, 0x0, 0x0)
    github.com/anacrolix/torrent@v1.52.6-0.20231201115409-7ea994b6bbd8/torrent.go:1936 +0x234
github.com/anacrolix/torrent.(*Torrent).dropConnection(0xc0434bb808, 0xc0b8198a88, 0x0, 0x0)
    github.com/anacrolix/torrent@v1.52.6-0.20231201115409-7ea994b6bbd8/torrent.go:1983 +0x65
github.com/anacrolix/torrent.(*PeerConn).drop(...)
    github.com/anacrolix/torrent@v1.52.6-0.20231201115409-7ea994b6bbd8/peerconn.go:1243
github.com/anacrolix/torrent.(*Torrent).maybeDropMutuallyCompletePeer(0xc035d9f400?, 0xc0b8198a88, 0x0, 0x0)
    github.com/anacrolix/torrent@v1.52.6-0.20231201115409-7ea994b6bbd8/torrent.go:1285 +0x173
github.com/anacrolix/torrent.(*PeerConn).peerPiecesChanged(...)
    github.com/anacrolix/torrent@v1.52.6-0.20231201115409-7ea994b6bbd8/peerconn.go:1350
github.com/anacrolix/torrent.(*PeerConn).peerHasAllPiecesTriggers(0xc0b8198a88, 0x1?, 0x1)
    github.com/anacrolix/torrent@v1.52.6-0.20231201115409-7ea994b6bbd8/peerconn.go:573 +0x125
github.com/anacrolix/torrent.(*PeerConn).onPeerHasAllPieces(0xc0b8198a88, 0x1, 0x1)
    github.com/anacrolix/torrent@v1.52.6-0.20231201115409-7ea994b6bbd8/peerconn.go:554 +0x39
github.com/anacrolix/torrent.(*PeerConn).onPeerSentHaveAll(...)
    github.com/anacrolix/torrent@v1.52.6-0.20231201115409-7ea994b6bbd8/peerconn.go:577
github.com/anacrolix/torrent.(*PeerConn).mainReadLoop(0xc0b8198a88)
    github.com/anacrolix/torrent@v1.52.6-0.20231201115409-7ea994b6bbd8/peerconn.go:1004 +0xc26
github.com/anacrolix/torrent.(*Torrent).runHandshookConn(0xc0434bb808, 0xc0b8198a88, 0x1?)
    github.com/anacrolix/torrent@v1.52.6-0.20231201115409-7ea994b6bbd8/client.go:1123 +0xb2
github.com/anacrolix/torrent.(*Torrent).logRunHandshookConn(0xc0434bb808, 0x29d8d29?, 0x0, {0x0?}, 0x0?)
    github.com/anacrolix/torrent@v1.52.6-0.20231201115409-7ea994b6bbd8/torrent.go:2083 +0x3b
github.com/anacrolix/torrent.(*Torrent).runHandshookConnLoggingErr(...)
    github.com/anacrolix/torrent@v1.52.6-0.20231201115409-7ea994b6bbd8/torrent.go:2090
github.com/anacrolix/torrent.(*Client).runReceivedConn(0xc000fc1008, 0xc0b8198a88)
    github.com/anacrolix/torrent@v1.52.6-0.20231201115409-7ea994b6bbd8/client.go:1066 +0x119
github.com/anacrolix/torrent.(*Client).incomingConnection(0xc000fc1008, {0x31f21b8, 0xc0aff69940})
    github.com/anacrolix/torrent@v1.52.6-0.20231201115409-7ea994b6bbd8/client.go:605 +0x346
created by github.com/anacrolix/torrent.(*Client).acceptConnections.func1 in goroutine 12274367
    github.com/anacrolix/torrent@v1.52.6-0.20231201115409-7ea994b6bbd8/client.go:565 +0x1e9
AskAlexSharov commented 3 days ago

-race found some:

==================
WARNING: DATA RACE
Write at 0x00c0413761c0 by goroutine 4308:
  github.com/anacrolix/torrent.(*Peer).updateRequests.func1()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/peer.go:602 +0xe4
  github.com/anacrolix/torrent.(*Peer).updateRequests()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/peer.go:604 +0x4d
  github.com/anacrolix/torrent.(*PeerConn).peerHasAllPiecesTriggers()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/peerconn.go:571 +0x225
  github.com/anacrolix/torrent.(*PeerConn).onPeerHasAllPieces()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/peerconn.go:554 +0x4c
  github.com/anacrolix/torrent.(*PeerConn).onPeerSentHaveAll()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/peerconn.go:577 +0x15ca
  github.com/anacrolix/torrent.(*PeerConn).mainReadLoop()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/peerconn.go:1004 +0x15cb
  github.com/anacrolix/torrent.(*Torrent).runHandshookConn()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/client.go:1123 +0x118
  github.com/anacrolix/torrent.(*Torrent).logRunHandshookConn()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/torrent.go:2083 +0x6d
  github.com/anacrolix/torrent.(*Torrent).runHandshookConnLoggingErr()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/torrent.go:2090 +0x1f8
  github.com/anacrolix/torrent.(*Client).runReceivedConn()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/client.go:1066 +0x1c9
  github.com/anacrolix/torrent.(*Client).incomingConnection()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/client.go:605 +0x3f9
  github.com/anacrolix/torrent.(*Client).acceptConnections.func1.gowrap1()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/client.go:565 +0x4f

Previous read at 0x00c0413761c0 by goroutine 4354:
  github.com/anacrolix/torrent.(*Peer).maybeUpdateActualRequestState()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/requesting.go:324 +0x7c
  github.com/anacrolix/torrent.(*PeerConn).fillWriteBuffer()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/peerconn.go:387 +0x104
  github.com/anacrolix/torrent.(*PeerConn).startMessageWriter.(*PeerConn).initMessageWriter.func1()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/peer-conn-msg-writer.go:22 +0x54
  github.com/anacrolix/torrent.(*peerConnMsgWriter).run()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/peer-conn-msg-writer.go:69 +0x124
  github.com/anacrolix/torrent.(*PeerConn).messageWriterRunner()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/peer-conn-msg-writer.go:41 +0x11d
  github.com/anacrolix/torrent.(*PeerConn).startMessageWriter.gowrap1()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/peer-conn-msg-writer.go:36 +0x33

Goroutine 4308 (running) created at:
  github.com/anacrolix/torrent.(*Client).acceptConnections.func1()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/client.go:565 +0x2b9

Goroutine 4354 (running) created at:
  github.com/anacrolix/torrent.(*PeerConn).startMessageWriter()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/peer-conn-msg-writer.go:36 +0x2ed
  github.com/anacrolix/torrent.(*Torrent).runHandshookConn.func1()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/client.go:1112 +0x8f7
  github.com/anacrolix/torrent.(*Torrent).runHandshookConn()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/client.go:1116 +0x64
  github.com/anacrolix/torrent.(*Torrent).logRunHandshookConn()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/torrent.go:2083 +0x6d
  github.com/anacrolix/torrent.(*Torrent).runHandshookConnLoggingErr()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/torrent.go:2090 +0x1f8
  github.com/anacrolix/torrent.(*Client).runReceivedConn()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/client.go:1066 +0x1c9
  github.com/anacrolix/torrent.(*Client).incomingConnection()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/client.go:605 +0x3f9
  github.com/anacrolix/torrent.(*Client).acceptConnections.func1.gowrap1()
      /home/ubuntu/go/pkg/mod/github.com/erigontech/torrent@v1.54.2-alpha-24/client.go:565 +0x4f
==================