go-libp2p
go-libp2p copied to clipboard
panic: runtime error: slice bounds out of range
v0.24.2
caught panic: runtime error: slice bounds out of range [:19] with capacity 1
goroutine 2503483111 [running]:
runtime/debug.Stack()
/usr/local/go/src/runtime/debug/stack.go:24 +0x65
github.com/multiformats/go-multistream.SelectWithSimopenOrFail.func1()
pkg/mod/github.com/multiformats/[email protected]/client.go:103 +0x58
panic({0x26c3f20, 0xc017c6a4f8})
/usr/local/go/src/runtime/panic.go:838 +0x207
github.com/libp2p/go-libp2p/p2p/net/pnet.(*pskConn).Read(0xc0b72b09c0, {0xc05920ab90, 0x10?, 0x1})
pkg/mod/github.com/libp2p/[email protected]/p2p/net/pnet/psk_conn.go:43 +0x185
github.com/multiformats/go-multistream.(*byteReader).ReadByte(0xc04ebcd770)
pkg/mod/github.com/multiformats/[email protected]/multistream.go:328 +0x4e
github.com/multiformats/go-varint.ReadUvarint({0x385c7e0, 0xc04ebcd770})
pkg/mod/github.com/multiformats/[email protected]/varint.go:80 +0x5a
github.com/multiformats/go-multistream.lpReadBuf({0x21b2748ca18?, 0xc0b72b09c0})
pkg/mod/github.com/multiformats/[email protected]/multistream.go:292 +0x94
github.com/multiformats/go-multistream.ReadNextTokenBytes({0x21b2748ca18?, 0xc0b72b09c0?})
pkg/mod/github.com/multiformats/[email protected]/multistream.go:275 +0x27
github.com/multiformats/go-multistream.ReadNextToken(...)
pkg/mod/github.com/multiformats/[email protected]/multistream.go:264
github.com/multiformats/go-multistream.SelectWithSimopenOrFail({0xc000cbfae0?, 0x2, 0x2}, {0x21b2748c9e8?, 0xc0b72b09c0})
pkg/mod/github.com/multiformats/[email protected]/client.go:128 +0x1e5
github.com/libp2p/go-libp2p/p2p/net/upgrader.(*upgrader).negotiateSecurity.func1()
pkg/mod/github.com/libp2p/[email protected]/p2p/net/upgrader/upgrader.go:327 +0x167
created by github.com/libp2p/go-libp2p/p2p/net/upgrader.(*upgrader).negotiateSecurity
pkg/mod/github.com/libp2p/[email protected]/p2p/net/upgrader/upgrader.go:318 +0x112
Receive error a day or two later.
Does this also happen with a recent version of go-libp2p?
Didn't try in the recent version of go-libp2p, this error doesn't always happen, it's random.
This looks similar to https://github.com/libp2p/go-yamux/issues/65. Interestingly, we thought that this bug only occurred on Windows, whereas here it seems to occur on Linux as well.