Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

LazyChunkReader.ReadAt panics if off>0 #413

Closed
gbalint opened this issue Apr 20, 2018 · 1 comment
Closed

LazyChunkReader.ReadAt panics if off>0 #413

gbalint opened this issue Apr 20, 2018 · 1 comment
Assignees

Comments

@gbalint
Copy link

gbalint commented Apr 20, 2018

LazyChunkReader.ReadAt does not work well if off>0
E.g. if I call it with 1 for a reader on a chunk with length 16777216 it panics:

panic: runtime error: slice bounds out of range

goroutine 279475 [running]:
github.com/ethereum/go-ethereum/swarm/storage.(*LazyChunkReader).join.func1(0xc4200ba480, 0x408, 0x408, 0xc420211340, 0xc4202acc60, 0x1, 0xc4200274f8, 0xc4202acba0, 0xc425f279b0, 0xc423caa000, ...)
	/Users/gbalint/go/src/github.com/ethereum/go-ethereum/swarm/storage/chunker.go:517 +0x3c9
created by github.com/ethereum/go-ethereum/swarm/storage.(*LazyChunkReader).join
	/Users/gbalint/go/src/github.com/ethereum/go-ethereum/swarm/storage/chunker.go:516 +0x2f3
FAIL	github.com/ethereum/go-ethereum/swarm/storage	2.212s

Strongly connected to this issue: #344

@nonsense
Copy link
Contributor

I got this on the test cluster as well, so it is not just a problem within tests.

swarm_8505 panic: runtime error: slice bounds out of range
swarm_8505                                                                                                                                                                   swarm_8505 goroutine 2830 [running]:
swarm_8505 github.com/ethereum/go-ethereum/swarm/storage.(*LazyChunkReader).join.func1(0xc420123b00, 0x8a8, 0x8a8, 0xc421ca6ee0, 0xc42164d380, 0x0, 0xc421b843a8, 0xc42164d2c0, 0xc421b84688, 0xc422dee000, ...)
swarm_8505      /go/src/github.com/ethereum/go-ethereum/swarm/storage/chunker.go:519 +0x52e                                                                                  swarm_8505 created by github.com/ethereum/go-ethereum/swarm/storage.(*LazyChunkReader).join
swarm_8505      /go/src/github.com/ethereum/go-ethereum/swarm/storage/chunker.go:518 +0x2f3

Difference within the line numbers is due to tracing I've added.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants