SiaFoundation / hostd

The next-generation of Sia storage providing software. More performant. More stable. Support for larger nodes.
https://sia.tech/software/hostd
MIT License
39 stars 11 forks source link

Figure out what is causing `hostd` to return massive `OutputLength` in `RPCExecuteProgramResponse` #406

Closed ChrisSchinnerl closed 5 months ago

ChrisSchinnerl commented 5 months ago

As the title suggests a huge number was returned, killing Arequipa. Fixes for both renterd and core are ready but we should still investigate why this might happen. Possibly an underflow.

Stacktrace from renterd for reference

panic: runtime error: makeslice: len out of range

goroutine 392948 [running]:
go.sia.tech/core/rhp/v3.(*RPCExecuteProgramResponse).DecodeFrom(0xc009ccadc0, 0xc00e6a2700)
    /go/pkg/mod/go.sia.tech/core@v0.2.3/rhp/v3/encoding.go:326 +0x21d
go.sia.tech/core/rhp/v3.(*rpcResponse).DecodeFrom(0xc00053e510, 0x40005a?)
    /go/pkg/mod/go.sia.tech/core@v0.2.3/rhp/v3/encoding.go:81 +0x83
go.sia.tech/core/rhp/v3.(*Stream).readObject(0xc01cd15d00?, {0x1ab24e0, 0xc009ccadc0}, 0x0?)
    /go/pkg/mod/go.sia.tech/core@v0.2.3/rhp/v3/transport.go:82 +0x1b7
go.sia.tech/core/rhp/v3.(*Stream).ReadResponse(0xb886be?, {0x1ab24e0?, 0xc009ccadc0?}, 0xc005534460?)
    /go/pkg/mod/go.sia.tech/core@v0.2.3/rhp/v3/transport.go:194 +0x5e
go.sia.tech/renterd/worker.(*streamV3).ReadResponse(0x5065747563657845?, {0x1ab24e0?, 0xc009ccadc0?}, 0x1ab23c8?)
    /renterd/worker/rhpv3.go:149 +0x65
go.sia.tech/renterd/worker.RPCAppendSector({_, _}, _, {_, _, _}, {{0x84, 0x9c, 0x7e, 0xc1, ...}, ...}, ...)
    /renterd/worker/rhpv3.go:841 +0x46a
go.sia.tech/renterd/worker.(*host).UploadSector.func1({0x1ab6368?, 0xc00e01bc70?}, 0xc002df8c20?)
    /renterd/worker/host.go:148 +0xca
go.sia.tech/renterd/worker.(*transportPoolV3).withTransportV3(0xc0021ec4f0, {0x1ab6368, 0xc00e01bc70}, {0x21, 0xed, 0xe3, 0xa8, 0x8e, 0xf1, 0x69, ...}, ...)
    /renterd/worker/rhpv3.go:264 +0x175
go.sia.tech/renterd/worker.(*host).UploadSector(_, {_, _}, {0x8a, 0x21, 0x13, 0xde, 0xe3, 0x9b, 0xa0, ...}, ...)
    /renterd/worker/host.go:147 +0x3c6
go.sia.tech/renterd/worker.(*uploader).execute(0xc02394a120, 0xc00ee63f80)
    /renterd/worker/uploader.go:302 +0x793
go.sia.tech/renterd/worker.(*uploader).Start(0xc02394a120)
    /renterd/worker/uploader.go:122 +0x194
created by go.sia.tech/renterd/worker.(*uploadManager).refreshUploaders in goroutine 384565
    /renterd/worker/upload.go:736 +0x6ea