Xray-core icon indicating copy to clipboard operation
Xray-core copied to clipboard

panic: runtime error: slice bounds out of range [2:0]

Open ffallah opened this issue 3 years ago • 1 comments

xray 1.6.1 crashes with the following error in log :

panic: runtime error: slice bounds out of range [2:0]

goroutine 1699405 [running]: github.com/xtls/xray-core/common/buf.(*Buffer).Read(...) github.com/xtls/xray-core/common/buf/buffer.go:253 github.com/xtls/xray-core/common/buf.SplitBytes({0xc00c62b7d8, 0x1, 0x1}, {0xc007b5a000?, 0xc00b170e70?, 0xc006a07dfc?}) github.com/xtls/xray-core/common/buf/multi_buffer.go:105 +0x290 github.com/xtls/xray-core/common/buf.(*BufferedReader).Read(0xc00bce2570, {0xc007b5a000?, 0xc00bb9e060?, 0x0?}) github.com/xtls/xray-core/common/buf/reader.go:68 +0x92 io.ReadAtLeast({0x11ca3c0, 0xc00bce2570}, {0xc007b5a000, 0x2e, 0x2000}, 0x2e) io/io.go:332 +0x9a io.ReadFull(...) io/io.go:351 github.com/xtls/xray-core/common/buf.(*Buffer).ReadFullFrom(0xc00bb9e060?, {0x11ca3c0?, 0xc00bce2570?}, 0x2?) github.com/xtls/xray-core/common/buf/buffer.go:276 +0x85 github.com/xtls/xray-core/proxy/vless/encoding.(*LengthPacketReader).ReadMultiBuffer(0xc002c2dfb0) github.com/xtls/xray-core/proxy/vless/encoding/addons.go:180 +0x205 github.com/xtls/xray-core/common/buf.copyInternal({0x11cb1c0, 0xc002c2dfb0}, {0x11c9700, 0xc00bb6abc0}, 0xc00b7338a8) github.com/xtls/xray-core/common/buf/copy.go:81 +0x69 github.com/xtls/xray-core/common/buf.Copy({0x11cb1c0, 0xc002c2dfb0}, {0x11c9700, 0xc00bb6abc0}, {0xc001394f20, 0x1, 0xc001394f18?}) github.com/xtls/xray-core/common/buf/copy.go:104 +0xa5 github.com/xtls/xray-core/proxy/vless/inbound.(*Handler).Process.func4() github.com/xtls/xray-core/proxy/vless/inbound/inbound.go:514 +0x1f9 github.com/xtls/xray-core/common/task.OnSuccess.func1() github.com/xtls/xray-core/common/task/task.go:12 +0x25 github.com/xtls/xray-core/common/task.Run.func1(0xc0005c2001?) github.com/xtls/xray-core/common/task/task.go:28 +0x2e created by github.com/xtls/xray-core/common/task.Run github.com/xtls/xray-core/common/task/task.go:27 +0xde

ffallah avatar Dec 10 '22 15:12 ffallah

Another one :

panic: runtime error: slice bounds out of range [28:0]

goroutine 150235 [running]: github.com/xtls/xray-core/common/buf.(*Buffer).Read(...) github.com/xtls/xray-core/common/buf/buffer.go:253 github.com/xtls/xray-core/common/buf.SplitBytes({0xc011482aa8, 0x1, 0x1}, {0xc008c0a000?, 0xc0106603c0?, 0xc011ba6f78?}) github.com/xtls/xray-core/common/buf/multi_buffer.go:105 +0x290 github.com/xtls/xray-core/common/buf.(*BufferedReader).Read(0xc0107af1d0, {0xc008c0a000?, 0xc010760d50?, 0x0?}) github.com/xtls/xray-core/common/buf/reader.go:68 +0x92 io.ReadAtLeast({0x11ca3c0, 0xc0107af1d0}, {0xc008c0a000, 0x22, 0x2000}, 0x22) io/io.go:332 +0x9a io.ReadFull(...) io/io.go:351 github.com/xtls/xray-core/common/buf.(*Buffer).ReadFullFrom(0xc010760d50?, {0x11ca3c0?, 0xc0107af1d0?}, 0x2?) github.com/xtls/xray-core/common/buf/buffer.go:276 +0x85 github.com/xtls/xray-core/proxy/vless/encoding.(*LengthPacketReader).ReadMultiBuffer(0xc010760d20) github.com/xtls/xray-core/proxy/vless/encoding/addons.go:180 +0x205 github.com/xtls/xray-core/common/buf.copyInternal({0x11cb1c0, 0xc010760d20}, {0x11c9700, 0xc0117b9460}, 0xc011d2c750) github.com/xtls/xray-core/common/buf/copy.go:81 +0x69 github.com/xtls/xray-core/common/buf.Copy({0x11cb1c0, 0xc010760d20}, {0x11c9700, 0xc0117b9460}, {0xc00e256f20, 0x1, 0x0?}) github.com/xtls/xray-core/common/buf/copy.go:104 +0xa5 github.com/xtls/xray-core/proxy/vless/inbound.(*Handler).Process.func4() github.com/xtls/xray-core/proxy/vless/inbound/inbound.go:514 +0x1f9 github.com/xtls/xray-core/common/task.OnSuccess.func1() github.com/xtls/xray-core/common/task/task.go:12 +0x25 github.com/xtls/xray-core/common/task.Run.func1(0xc011d7d8c0?) github.com/xtls/xray-core/common/task/task.go:28 +0x2e created by github.com/xtls/xray-core/common/task.Run github.com/xtls/xray-core/common/task/task.go:27 +0xde

ffallah avatar Dec 11 '22 01:12 ffallah

https://github.com/XTLS/Xray-core/issues/1501#issuecomment-1375293435

RPRX avatar Jan 09 '23 09:01 RPRX