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

panic: extending out of bound

Open fengweiyuan opened this issue 5 months ago • 3 comments

v5.41.0 版本,在 amazon linux 2023 上跑,突然就退出了,非必现,日志如下。

Dec 01 16:47:53 ecm-d551-0004 v2ray[66122]: panic: extending out of bound
Dec 01 16:47:53 ecm-d551-0004 v2ray[66122]: goroutine 193 [running]:
Dec 01 16:47:53 ecm-d551-0004 v2ray[66122]: github.com/v2fly/v2ray-core/v5/common/buf.(*Buffer).Extend(...)
Dec 01 16:47:53 ecm-d551-0004 v2ray[66122]:         github.com/v2fly/v2ray-core/v5/common/buf/buffer.go:111
Dec 01 16:47:53 ecm-d551-0004 v2ray[66122]: github.com/v2fly/v2ray-core/v5/proxy/shadowsocks.(*AEADCipher).EncodePacket(0xc0009e54d0?, {0xc000542590?, 0xc0009e54d0?, 0x199c200?}, 0xc0009e54d0)
Dec 01 16:47:53 ecm-d551-0004 v2ray[66122]:         github.com/v2fly/v2ray-core/v5/proxy/shadowsocks/config.go:168 +0x232
Dec 01 16:47:53 ecm-d551-0004 v2ray[66122]: github.com/v2fly/v2ray-core/v5/proxy/shadowsocks.EncodeUDPPacket(0xc000392030, {0xc000159000, 0x800, 0x8f6516?})
Dec 01 16:47:53 ecm-d551-0004 v2ray[66122]:         github.com/v2fly/v2ray-core/v5/proxy/shadowsocks/protocol.go:201 +0x1e3
Dec 01 16:47:53 ecm-d551-0004 v2ray[66122]: github.com/v2fly/v2ray-core/v5/proxy/shadowsocks.(*Server).handlerUDPPayload.func1({0x199c120, 0xc000036730}, 0xc0009ea5c0)
Dec 01 16:47:53 ecm-d551-0004 v2ray[66122]:         github.com/v2fly/v2ray-core/v5/proxy/shadowsocks/server.go:94 +0x148
Dec 01 16:47:53 ecm-d551-0004 v2ray[66122]: github.com/v2fly/v2ray-core/v5/transport/internet/udp.handleInput({0x199c120, 0xc000036730}, 0x0?, {{0x199c200?, 0xc000543e8c?}, 0x3764?, 0x0?}, 0xc>
Dec 01 16:47:53 ecm-d551-0004 v2ray[66122]:         github.com/v2fly/v2ray-core/v5/transport/internet/udp/dispatcher_split.go:119 +0x262
Dec 01 16:47:53 ecm-d551-0004 v2ray[66122]: created by github.com/v2fly/v2ray-core/v5/transport/internet/udp.(*Dispatcher).getInboundRay in goroutine 191
Dec 01 16:47:53 ecm-d551-0004 v2ray[66122]:         github.com/v2fly/v2ray-core/v5/transport/internet/udp/dispatcher_split.go:80 +0x4c5
Dec 01 16:47:53 ecm-d551-0004 systemd[1]: v2ray.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Dec 01 16:47:53 ecm-d551-0004 systemd[1]: v2ray.service: Failed with result 'exit-code'.
Dec 01 16:47:53 ecm-d551-0004 systemd[1]: v2ray.service: Scheduled restart job, restart counter is at 6.
Dec 01 16:47:53 ecm-d551-0004 systemd[1]: Stopped V2Ray Service.
Dec 01 16:47:53 ecm-d551-0004 systemd[1]: v2ray.service: Start request repeated too quickly.
Dec 01 16:47:53 ecm-d551-0004 systemd[1]: v2ray.service: Failed with result 'exit-code'.
Dec 01 16:47:53 ecm-d551-0004 systemd[1]: Failed to start V2Ray Service.
Dec 01 18:38:56 ecm-d551-0004 systemd[1]: Started V2Ray Service.

fengweiyuan avatar Dec 01 '25 10:12 fengweiyuan

补充我的 json 配置

{
  "inbounds": [
    {
      "port": 9794,
      "listen": "0.0.0.0",
      "protocol": "shadowsocks",
      "settings": {
        "method": "aes-128-gcm",
        "password": "xxxxxxxxxx",
        "network": "tcp,udp"
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {}
    }
  ]
}

fengweiyuan avatar Dec 01 '25 11:12 fengweiyuan

already fixed, need merged. https://github.com/v2fly/v2ray-core/pull/3564/commits/d1869daefeb0c0034c272c017d1f4e5ef75e3194

fengweiyuan avatar Dec 01 '25 11:12 fengweiyuan

https://github.com/v2fly/v2ray-core/issues/3205#issuecomment-2557229993

dyhkwong avatar Dec 02 '25 03:12 dyhkwong