Skip to content

Fix port "0" listen - #6640

Open
Fangliding wants to merge 3 commits into
mainfrom
uds-listen
Open

Fix port "0" listen#6640
Fangliding wants to merge 3 commits into
mainfrom
uds-listen

Conversation

@Fangliding

@Fangliding Fangliding commented Aug 17, 2026

Copy link
Copy Markdown
Member

close #6636

附带一些其他panic 和 close #6600

@bytecategory

Copy link
Copy Markdown
Contributor

我觉得不要急着合并, bye-panic这个分支代表了还有不少Build成功但"运行时具体状态"和下游假设不一致的问题.
例如
root@ubuntu:/fuzz# cat domain-udp-00114514.json
{
"inbounds": [
{
"listen": "",
"port": 11451,
"protocol": "dokodemo-door",
"settings": {
"udp": true
}
}
]
}
root@ubuntu:
/fuzz# ./xray -c domain-udp-00114514.json
Xray 26.3.27 (Xray, Penetrates Everything.) d2758a0 (go1.26.1 linux/amd64)
A unified platform for anti-censorship.
2026/08/17 20:55:08.774167 [Info] infra/conf/serial: Reading config: &{Name:domain-udp-00114514.json Format:json}
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/xtls/xray-core/infra/conf.(*InboundDetourConfig).Build(0x1a883ddef948)
github.com/xtls/xray-core/infra/conf/xray.go:152 +0xeca
github.com/xtls/xray-core/infra/conf.(*Config).Build(0x1a883dcb32c0)
github.com/xtls/xray-core/infra/conf/xray.go:596 +0x188f
github.com/xtls/xray-core/infra/conf/serial.BuildConfig({0x1a883dc921c0?, 0x1a883dcbf050?, 0x1a883ddefbe8?})
github.com/xtls/xray-core/infra/conf/serial/builder.go:52 +0x2a
github.com/xtls/xray-core/core.LoadConfig({0x17d54c2, 0x4}, {0x15299e0?, 0x1a883dcbf050?})
github.com/xtls/xray-core/core/config.go:150 +0x56e
main.startXray()
github.com/xtls/xray-core/main/run.go:223 +0x15c
main.executeRun(0x26d20c0?, {0x1a883dc8b520?, 0x800883dc94700?, 0x7b56937201e8?})
github.com/xtls/xray-core/main/run.go:78 +0x130
github.com/xtls/xray-core/main/commands/base.Execute()
github.com/xtls/xray-core/main/commands/base/execute.go:64 +0x69f
main.main()
github.com/xtls/xray-core/main/main.go:22 +0x1a5

@bytecategory

bytecategory commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

现在感觉可以了. 暂时找不到新的

@bytecategory

bytecategory commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

root@ubuntu:~/Downloads/Xray-linux-64_26.7.28# ./xray -c config.json
Xray 26.7.28 (Xray, Penetrates Everything.) 5ca6f4b (go1.26.5 linux/amd64)
A unified platform for anti-censorship.
2026/08/19 15:45:58.531083 [Info] infra/conf/serial: Reading config: &{Name:1.json Format:json}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x13a3354]

goroutine 1 [running]:
github.com/xtls/xray-core/infra/conf.(*Address).Build(...)
github.com/xtls/xray-core/infra/conf/common.go:68
github.com/xtls/xray-core/infra/conf.(*SocksClientConfig).Build(0x38ba37b1b680)
github.com/xtls/xray-core/infra/conf/socks.go:108 +0x174
github.com/xtls/xray-core/infra/conf.(*OutboundDetourConfig).Build(0x38ba37d6b8f0)
github.com/xtls/xray-core/infra/conf/xray.go:364 +0xf7a
github.com/xtls/xray-core/infra/conf.(*Config).Build(0x38ba37f12420)
github.com/xtls/xray-core/infra/conf/xray.go:681 +0x1de5
github.com/xtls/xray-core/infra/conf/serial.BuildConfig({0x38ba37abe208?, 0x38ba37accb70?, 0x38ba37d6bbe8?})
github.com/xtls/xray-core/infra/conf/serial/builder.go:66 +0x2a
github.com/xtls/xray-core/core.LoadConfig({0x1871c5f, 0x4}, {0x15a9ec0?, 0x38ba37accb70?})
github.com/xtls/xray-core/core/config.go:150 +0x56e
main.startXray()
github.com/xtls/xray-core/main/run.go:219 +0x15c
main.executeRun(0x27e8060?, {0x38ba37f0fde0?, 0x800ba37f0a540?, 0x78ff18c72f60?})
github.com/xtls/xray-core/main/run.go:82 +0x130
github.com/xtls/xray-core/main/commands/base.Execute()
github.com/xtls/xray-core/main/commands/base/execute.go:64 +0x69f
main.main()
github.com/xtls/xray-core/main/main.go:22 +0x1a5
root@ubuntu:~/Downloads/Xray-linux-64_26.7.28# cat config.json
{
"outbounds": [
{
"protocol": "socks",
"settings": {
"servers": [
{
"port": 10801
}
]
}
}
]
}
修复方法: 检查 serverConfig.Address 是否为nil (现在以 1318802 为准)
还有另外一个注释"just panic",(downloadSettings 空目的地导致SplitHTTP nil dereference),我不清楚这么做是不是好的办法. #5997

@bytecategory bytecategory left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

root@ubuntu:~/Xray-core# ./xray -c x.json
Xray 26.7.28 (Xray, Penetrates Everything.) Custom (go1.26.5 linux/amd64)
A unified platform for anti-censorship.
2026/08/20 13:59:16.392675 [Info] infra/conf/serial: Reading config: &{Name:1.json Format:json}
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/xtls/xray-core/infra/conf.validateOutboundTransportSecurity({0x13a3ca0?, 0xb9ff451c960?}, 0x3b?)
github.com/xtls/xray-core/infra/conf/xray.go:254 +0x166
github.com/xtls/xray-core/infra/conf.(*OutboundDetourConfig).Build(0xb9ff44db988)
github.com/xtls/xray-core/infra/conf/xray.go:361 +0x867
github.com/xtls/xray-core/infra/conf.(*Config).Build(0xb9ff46b0580)
github.com/xtls/xray-core/infra/conf/xray.go:681 +0x17cd
github.com/xtls/xray-core/infra/conf/serial.BuildConfig({0xb9ff43a23d0?, 0x7838ee7601e8?, 0x7839353f9bf0?})
github.com/xtls/xray-core/infra/conf/serial/builder.go:66 +0x2a
github.com/xtls/xray-core/core.LoadConfig({0x160c85f, 0x4}, {0x13428c0?, 0xb9ff43cf368?})
github.com/xtls/xray-core/core/config.go:150 +0x56e
main.startXray()
github.com/xtls/xray-core/main/run.go:219 +0x8f
main.executeRun(0x23d0620?, {0xb9ff44bf5e0?, 0x48f9e6?, 0x8000000000040?})
github.com/xtls/xray-core/main/run.go:82 +0x54
github.com/xtls/xray-core/main/commands/base.Execute()
github.com/xtls/xray-core/main/commands/base/execute.go:64 +0x59f
main.main()
github.com/xtls/xray-core/main/main.go:22 +0x1a5
root@ubuntu:~/Xray-core# cat x.json
{
"log": {
"loglevel": "warning"
},
"outbounds": [
{
"protocol": "vless",
"settings": {
"vnext": [],
"encryption": "none"
},
"streamSettings": {
"network": "tcp",
"security": "none"
}
}
]
}
因为你加了一个vnext[0] 引入了一个新的panic,本来应该failed to build outbound config with tag > infra/conf: failed to build outbound handler for protocol vless > infra/conf: VLESS settings: "vnext" should have one and only one member. Multiple endpoints in "vnext" should use multiple VLESS outbounds and routing balancer instead
这样的.
6b1fc59#diff-2683dbaba14bc856bb5c6f6e664313d25dd246b4e262deb3e886579b4f48a3b4R254
@Fangliding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

panic: pull/4945 的修复不全,只处理 raw,没有包含其他传输 Xray-core allows connection without tls when vnext is used

2 participants