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

Server occasionally crashes with "panic: extending out of bound"

Open poscat0x04 opened this issue 3 years ago • 1 comments

What version of V2Ray are you using?

This bug is server side and has happened once on 4.43 and once on 4.44

What's your scenario of using V2Ray?

I'm not sure what might have triggered this bug as it happens really rarely, like once every few month.

What problems have you encountered?

The server crashes with panic: exending out of bound

What's your expectation?

The server should not crash

Please attach error logs here

Server error log:

4.43:

panic: extending out of bound
goroutine 812481 [running]:
github.com/v2fly/v2ray-core/v4/common/buf.(*Buffer).Extend(...)
        github.com/v2fly/v2ray-core/v4/common/buf/buffer.go:79
github.com/v2fly/v2ray-core/v4/common/crypto.(*ChunkStreamWriter).WriteMultiBuffer(0xc00097ed80, 0xc0017fcea8, 0x0, 0x1, 0x0, 0x0)
        github.com/v2fly/v2ray-core/v4/common/crypto/chunk.go:150 +0x525
github.com/v2fly/v2ray-core/v4/common/buf.copyInternal(0x10886a0, 0xc0006b5790, 0x10873c0, 0xc00097ed80, 0xc000870c90, 0xc000d2fb01, 0xc000870c78)
        github.com/v2fly/v2ray-core/v4/common/buf/copy.go:87 +0x1b2
github.com/v2fly/v2ray-core/v4/common/buf.Copy(0x10886a0, 0xc0006b5790, 0x10873c0, 0xc00097ed80, 0xc000b07e48, 0x1, 0x1, 0xc0001d2e50, 0x40fe18)
        github.com/v2fly/v2ray-core/v4/common/buf/copy.go:104 +0xa8
github.com/v2fly/v2ray-core/v4/proxy/vmess/inbound.transferResponse(0x1087760, 0xc000d2fa70, 0xc000b93180, 0xc000d2f9e0, 0xc0001d2f40, 0x10886a0, 0xc0006b5790, 0xc000d2fbc0, 0xc000c27f00, 0x10886c0)
        github.com/v2fly/v2ray-core/v4/proxy/vmess/inbound/inbound.go:203 +0x1af
github.com/v2fly/v2ray-core/v4/proxy/vmess/inbound.(*Handler).Process.func2(0x0, 0x0)
        github.com/v2fly/v2ray-core/v4/proxy/vmess/inbound/inbound.go:309 +0x325
github.com/v2fly/v2ray-core/v4/common/task.Run.func1(0xc0006b57a0, 0xc000ead680, 0xc0009c4a00)
        github.com/v2fly/v2ray-core/v4/common/task/task.go:28 +0x2b
created by github.com/v2fly/v2ray-core/v4/common/task.Run
        github.com/v2fly/v2ray-core/v4/common/task/task.go:27 +0x152

4.44:

panic: extending out of bound
goroutine 13878250 [running]:
github.com/v2fly/v2ray-core/v4/common/buf.(*Buffer).Extend(...)
        github.com/v2fly/v2ray-core/v4/common/buf/buffer.go:79
github.com/v2fly/v2ray-core/v4/app/dispatcher.(*cachedReader).Cache(0xc00261cb10, 0xc000170ec0)
        github.com/v2fly/v2ray-core/v4/app/dispatcher/default.go:45 +0x1b1
github.com/v2fly/v2ray-core/v4/app/dispatcher.sniffer.func1({0xf328c0, 0xc00261c8a0}, 0xc00261c8a0, 0xc000170ec0, 0xc0023fb690)
        github.com/v2fly/v2ray-core/v4/app/dispatcher/default.go:276 +0x8e
github.com/v2fly/v2ray-core/v4/app/dispatcher.sniffer({0xf328c0, 0xc00261c8a0}, 0x40c9dd, 0x0)
        github.com/v2fly/v2ray-core/v4/app/dispatcher/default.go:288 +0x194
github.com/v2fly/v2ray-core/v4/app/dispatcher.(*DefaultDispatcher).Dispatch.func1()
        github.com/v2fly/v2ray-core/v4/app/dispatcher/default.go:236 +0x125
created by github.com/v2fly/v2ray-core/v4/app/dispatcher.(*DefaultDispatcher).Dispatch
        github.com/v2fly/v2ray-core/v4/app/dispatcher/default.go:231 +0x6c5

poscat0x04 avatar Apr 23 '22 09:04 poscat0x04

Could you provide your configuration?

AkinoKaede avatar Apr 23 '22 09:04 AkinoKaede

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] avatar Aug 22 '22 02:08 github-actions[bot]