XTLS / Xray-core

Xray, Penetrates Everything. Also the best v2ray-core, with XTLS support. Fully compatible configuration.
https://t.me/projectXray
Mozilla Public License 2.0
22.8k stars 3.65k forks source link

xray 1.4.2 docker 有时会出错重启 panic: runtime error: slice bounds out of range [28:0] #624

Closed bigbighill closed 1 year ago

bigbighill commented 3 years ago

Xray 1.4.2 (Xray, Penetrates Everything.) Custom (go1.16.2 linux/amd64) A unified platform for anti-censorship. 2021/06/28 19:26:58 [Info] infra/conf/serial: Reading config: /etc/xray/config.json panic: runtime error: slice bounds out of range [2:0]

goroutine 226 [running]: github.com/xtls/xray-core/common/buf.(Buffer).Read(...) github.com/xtls/xray-core/common/buf/buffer.go:203 github.com/xtls/xray-core/common/buf.SplitBytes(0xc000098d18, 0x1, 0x1, 0xc000156000, 0x26, 0x2000, 0x0, 0x0, 0x203000, 0xc0003990b0) github.com/xtls/xray-core/common/buf/multi_buffer.go:105 +0x2db github.com/xtls/xray-core/common/buf.(BufferedReader).Read(0xc0003991d0, 0xc000156000, 0x26, 0x2000, 0x28, 0xee4ce0, 0x72c649) github.com/xtls/xray-core/common/buf/reader.go:68 +0x22d io.ReadAtLeast(0x10ba020, 0xc0003991d0, 0xc000156000, 0x26, 0x2000, 0x26, 0x40e158, 0x28, 0xee4ce0) io/io.go:328 +0x87 io.ReadFull(...) io/io.go:347 github.com/xtls/xray-core/common/buf.(Buffer).ReadFullFrom(0xc0004a6a20, 0x10ba020, 0xc0003991d0, 0xc000000026, 0x2, 0x2, 0x2) github.com/xtls/xray-core/common/buf/buffer.go:226 +0xab github.com/xtls/xray-core/proxy/vless/encoding.(LengthPacketReader).ReadMultiBuffer(0xc0004a69f0, 0x0, 0x18, 0xe79560, 0xc00000e3d0, 0xc0004bd098) github.com/xtls/xray-core/proxy/vless/encoding/addons.go:181 +0x205 github.com/xtls/xray-core/common/buf.copyInternal(0x10bad00, 0xc0004a69f0, 0x10bb660, 0xc000098d98, 0xc0004bd080, 0xb8dc01, 0xc0004bd068) github.com/xtls/xray-core/common/buf/copy.go:81 +0x49 github.com/xtls/xray-core/common/buf.Copy(0x10bad00, 0xc0004a69f0, 0x10bb660, 0xc000098d98, 0xc000161f38, 0x1, 0x1, 0x6c9e85, 0xc000234df0) github.com/xtls/xray-core/common/buf/copy.go:104 +0xa8 github.com/xtls/xray-core/proxy/vless/inbound.(*Handler).Process.func4(0x0, 0x0) github.com/xtls/xray-core/proxy/vless/inbound/inbound.go:516 +0x405 github.com/xtls/xray-core/common/task.OnSuccess.func1(0xc000551740, 0x0) github.com/xtls/xray-core/common/task/task.go:12 +0x2f github.com/xtls/xray-core/common/task.Run.func1(0xc000098e20, 0xc0003e7320, 0xc00000c750) github.com/xtls/xray-core/common/task/task.go:28 +0x2b created by github.com/xtls/xray-core/common/task.Run github.com/xtls/xray-core/common/task/task.go:27 +0x152 Xray 1.4.2 (Xray, Penetrates Everything.) Custom (go1.16.2 linux/amd64) A unified platform for anti-censorship. 2021/06/28 19:28:03 [Info] infra/conf/serial: Reading config: /etc/xray/config.json

bigbighill commented 3 years ago

config.json { "log": { "access": "/var/log/xray/access.log", "error": "/var/log/xray/error.log", "loglevel": "warning" }, "inbounds": [ { "port": 443, "protocol": "vless", "settings": { "clients": [ { "id": "xxxxxx", "flow": "xtls-rprx-direct", "level": 0, "email": "love@example.com" } ], "decryption": "none", "fallbacks": [ { "dest": 1310, "xver": 1 }, { "path": "/aaa", "dest": 3456, "xver": 1 }, { "path": "/bbb", "dest": 5678, "xver": 1 } ] }, "streamSettings": { "network": "tcp", "security": "xtls", "xtlsSettings": { "alpn": [ "http/1.1" ], "certificates": [ { "certificateFile": "/ssl/ddd.tk/ddd.tk.crt", "keyFile": "/ssl/ddd.tk/ddd.tk.key" } ] } } }, { "port": 5678, "listen": "127.0.0.1", "protocol": "dokodemo-door", "tag": "wsdoko", "settings": { "address": "v1.mux.cool", "followRedirect": false, "network": "tcp" }, "streamSettings": { "network": "ws", "wsSettings": { "acceptProxyProtocol": true, "path": "/bbb" } } }, { "port": 9015, "protocol": "shadowsocks", "settings": { "clients": [ { "password": "password", "method": "chacha20-ietf-poly1305", "network": "tcp,udp" } ] }, "streamSettings": { "network": "domainsocket" } }, { "port": 1310, "listen": "127.0.0.1", "protocol": "trojan", "settings": { "clients": [ { "password": "pass", "level": 0, "email": "love@example.com" }, { "password": "pass", "level": 0, "email": "love1@example.com" } ], "fallbacks": [ { "dest": "127.0.0.1:80" } ] }, "streamSettings": { "network": "tcp", "security": "none", "tcpSettings": { "acceptProxyProtocol": true } } }, { "port": 3456, "listen": "127.0.0.1", "protocol": "vmess", "settings": { "clients": [ { "id": "xxxxxx", "level": 0, "alterId": 15, "email": "love@example.com" } ] }, "streamSettings": { "network": "ws", "security": "none", "wsSettings": { "acceptProxyProtocol": true, "path": "/aaa" } } } ], "outbounds": [ { "protocol": "freedom" }, { "protocol": "blackhole", "settings": {}, "tag": "blocked" }, { "protocol": "freedom", "settings": {}, "tag": "direct" }, { "protocol": "freedom", "tag": "ssmux", "settings": { "redirect": "127.0.0.1:9015" } } ], "routing": { "domainStrategy": "IPOnDemand", "rules": [ { "type": "field", "inboundTag": [ "wsdoko" ], "outboundTag": "ssmux" }, { "type": "field", "ip": [ "0.0.0.0/8", "10.0.0.0/8", "100.64.0.0/10", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.2.0/24", "192.168.0.0/16", "198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "::1/128", "fc00::/7", "fe80::/10" ], "outboundTag": "blocked" }, { "type": "field", "protocol": [ "bittorrent" ], "outboundTag": "blocked" } ] }, "transport": { "sockopt": { "tcpFastOpen": true } } }

RPRX commented 1 year ago

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