We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I Read and Write concurrently by PipeReader and PipeWriter, I got this panic.
Read
Write
PipeReader
PipeWriter
panic: runtime error: slice bounds out of range [:147404] with capacity 65536 goroutine 244 [running]: github.com/beyondstorage/go-storage/v4/pkg/iowrap.(*PipeReader).Read(0xc0001ea238, 0xc00b510000, 0x8000, 0x8000, 0x0, 0x0, 0x0) /Users/lance/go/pkg/mod/github.com/beyondstorage/go-storage/[email protected]/pkg/iowrap/pipe.go:89 +0x28f io.(*LimitedReader).Read(0xc00074e9f0, 0xc00b510000, 0x8000, 0x8000, 0x3fcc, 0x0, 0x0) /usr/local/go/src/io/io.go:473 +0x63 io.copyBuffer(0x531fb40, 0xc0004a16e0, 0x531d140, 0xc00074e9f0, 0xc00b510000, 0x8000, 0x8000, 0x0, 0x0, 0xdb8fdc8) /usr/local/go/src/io/io.go:423 +0x12c io.Copy(...)
This panic can be simply reproducted by code below, with a source file size bigger than 65536:
65536
r, w := iowrap.Pipe() go func() { _, err := src.Read(arg.SrcPath, w) if err != nil { logger.Error("src read failed", zap.Error(err)) } }() _, err := dst.Write(arg.DstPath, r, arg.Size) if err != nil { logger.Error("write single file failed", zap.Error(err)) return err }
However, the range of slice is different every time.
The text was updated successfully, but these errors were encountered:
I'm investigating this issue, please use io.Pipe() until it is resolved.
io.Pipe()
Sorry, something went wrong.
We will remove this function in further release.
Xuanwo
No branches or pull requests
When I
Read
andWrite
concurrently byPipeReader
andPipeWriter
, I got this panic.This panic can be simply reproducted by code below, with a source file size bigger than
65536
:However, the range of slice is different every time.
The text was updated successfully, but these errors were encountered: