Open rjan90 opened 2 years ago
@LexLuthr found out that the crash is coming from the reader in the lotus storage:
func (r *unpadReader) Read(out []byte) (int, error) {
if r.left == 0 {
return 0, io.EOF
}
chunks := len(out) / 127
outTwoPow := 1 << (63 - bits.LeadingZeros64(uint64(chunks*128)))
if err := abi.PaddedPieceSize(outTwoPow).Validate(); err != nil {
return 0, xerrors.Errorf("output must be of valid padded piece size: %w", err)
}
todo := abi.PaddedPieceSize(outTwoPow)
if r.left < uint64(todo) {
todo = abi.PaddedPieceSize(1 << (63 - bits.LeadingZeros64(r.left)))
}
r.left -= uint64(todo)
n, err := io.ReadAtLeast(r.src, r.work[:todo], int(todo)) <--- ?Slice out of bound?
if err != nil && err != io.EOF {
return n, err
}
if n < int(todo) {
return 0, xerrors.Errorf("didn't read enough: %d / %d, left %d, out %d", n, todo, r.left, len(out))
}
Unpad(r.work[:todo], out[:todo.Unpadded()])
return int(todo.Unpadded()), err
}
@nonsense - is there any reason why boost is depend on lotus on this?
The code for reading data from the workers lives in lotus so boost needs to depend on lotus to use that code.
Checklist
Latest release
, or the most recent RC(release canadiate) for the upcoming release or the dev branch(master), or have an issue updating to any of these.Lotus component
Lotus Version
Describe the Bug
This is was an error reported initially by @stuberman in the Boost-repo, but the crash is coming from the reader in the lotus storage. Issue-report here.
When running
boostd dagstore initialize-all --concurrency=3
or evenboostd dagstore initialize-all --concurrency=1
then boostd crashes after a few minutes. See log below:Logging Information
Repo Steps
boostd dagstore initialize-all --concurrency=3
on a Boost-node