slice bounds out of rang
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Start at msgio.go:235 and inspect how go-msgio v0.0.6 sizes and slices its message buffer. Use the reported panic cases and the go-libp2p-secio/go-yamux call path to investigate reproduction. Done means these inputs no longer cause slice-bounds panics, with regression coverage added where the behavior can be tested.
Written by the indexing model from the issue text.
Description
`panic: runtime error: slice bounds out of range [:826] with capacity 512
goroutine 9921985 [running]:
github.com/libp2p/go-msgio.(*reader).ReadMsg(0xc00c5d44c0, 0x0, 0x0, 0x0, 0x0, 0x0)
D:/goWork/pkg/mod/github.com/libp2p/[email protected]/msgio.go:235 +0x2dc
github.com/libp2p/go-libp2p-secio.(*etmReader).fill(0xc0052e34a0, 0x1de, 0x0)
D:/goWork/pkg/mod/github.com/libp2p/[email protected]/rw.go:132 +0x3f
github.com/libp2p/go-libp2p-secio.(*etmReader).Read(0xc0052e34a0, 0xc00c525cd0, 0xc, 0xc, 0x0, 0x0, 0x0)
D:/goWork/pkg/mod/github.com/libp2p/[email protected]/rw.go:171 +0x2a5
io.ReadAtLeast(0x2a09e810, 0xc003127000, 0xc00c525cd0, 0xc, 0xc, 0xc, 0xc, 0x0, 0x0)
C:/Go/src/io/io.go:310 +0x8e
io.ReadFull(...)
C:/Go/src/io/io.go:329
github.com/libp2p/go-yamux.(*Session).recvLoop(0xc000131ce0, 0x0, 0x0)
D:/goWork/pkg/mod/github.com/libp2p/[email protected]/session.go:526 +0xe1
github.com/libp2p/go-yamux.(*Session).recv(0xc000131ce0)
D:/goWork/pkg/mod/github.com/libp2p/[email protected]/session.go:505 +0x32
created by github.com/libp2p/go-yamux.newSession
D:/goWork/pkg/mod/github.com/libp2p/[email protected]/session.go:125 +0x380
panic: runtime error: slice bounds out of range [:2158] with capacity 2048
goroutine 4538928 [running]:
github.com/libp2p/go-msgio.(*reader).ReadMsg(0xc00a7aae40, 0x0, 0x0, 0x0, 0x0, 0x0)
D:/goWork/pkg/mod/github.com/libp2p/[email protected]/msgio.go:235 +0x2dc
github.com/libp2p/go-libp2p-secio.(*etmReader).fill(0xc00066e500, 0x65d, 0x0)
D:/goWork/pkg/mod/github.com/libp2p/[email protected]/rw.go:132 +0x3f
github.com/libp2p/go-libp2p-secio.(*etmReader).Read(0xc00066e500, 0xc006460390, 0xc, 0xc, 0x0, 0x0, 0x0)
D:/goWork/pkg/mod/github.com/libp2p/[email protected]/rw.go:171 +0x2a5
io.ReadAtLeast(0x2a4a9c88, 0xc005b4a000, 0xc006460390, 0xc, 0xc, 0xc, 0xc, 0x0, 0x0)
C:/Go/src/io/io.go:310 +0x8e
io.ReadFull(...)
C:/Go/src/io/io.go:329
github.com/libp2p/go-yamux.(*Session).recvLoop(0xc001960e00, 0x0, 0x0)
D:/goWork/pkg/mod/github.com/libp2p/[email protected]/session.go:526 +0xe1
github.com/libp2p/go-yamux.(*Session).recv(0xc001960e00)
D:/goWork/pkg/mod/github.com/libp2p/[email protected]/session.go:505 +0x32
created by github.com/libp2p/go-yamux.newSession
D:/goWork/pkg/mod/github.com/libp2p/[email protected]/session.go:125 +0x380
panic: runtime error: slice bounds out of range [:798] with capacity 512
`
the go-msgio version we use is v0.0.6
#16
33cn/chain33/issues/1000
- Dominant language
- Go
- Stars
- 17
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from libp2p/go-msgio
-
Surprising error/panic when using protoio package with standard Google protobuf packagePossibly taken @MarcoPolo claimed this 623 days ago. Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
Similar issues
-
validateDeclaredPath lets control characters through into the Gradle init script's Groovy literalOpenagent-butler-finding agent-research bug ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
jordansmall/spindrift#5821 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
apache/rocketmq-dashboard#7243 ·
Maintainers usually reply within 3 days
-
Missing example coverage: getClockPossibly taken @camunda-sdk-automation claimed this today. Opennew-operations
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
camunda/orchestration-cluster-api-go#75 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
praetorianer777/Stator#465 ·
Maintainers usually reply within 1 day