Skip to content

Config: Fix some issues - #6640

Merged
RPRX merged 5 commits into
mainfrom
uds-listen
Aug 27, 2026
Merged

RPRX merged 5 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

This comment was marked as off-topic.

@Fangliding

Copy link
Copy Markdown
Member Author

不会崩啊。。。

@bytecategory

Copy link
Copy Markdown
Contributor

不会崩啊。。。

确实很奇怪, 我单独加入那个改动会崩溃. 现在我隐藏掉它了.

@Fangliding Fangliding changed the title Fix port "0" listen Fix some panic Aug 25, 2026
@Fangliding Fangliding changed the title Fix some panic Fix some json Aug 25, 2026
@RPRX

RPRX commented Aug 25, 2026

Copy link
Copy Markdown
Member

那两处直接 [0] 不会 panic 吧

另外补全所有被解决的问题的原始链接,不然我得去大海捞针

@Fangliding

Fangliding commented Aug 26, 2026 •

Copy link
Copy Markdown
Member Author

那两处直接 [0] 不会 panic 吧

不会 因为上面的vless构建proto的时候对它规范化了

另外补全所有被解决的问题的原始链接,不然我得去大海捞针

基本就是楼上反馈的那几个panic 还有我在desc贴的那几个link 还有个并进来的小修复 http出站写header块后收到没有session.inbound的请求会直接拒绝

@bytecategory

Copy link
Copy Markdown
Contributor

那两处直接 [0] 不会 panic 吧

#6640 (review) 这是一个重复的问题.
并且有了答案
#6640 (comment)

@RPRX

RPRX commented Aug 27, 2026

Copy link
Copy Markdown
Member

TCP 传输层更名 RAW 的好处体现出来了,不然 tcp/hub.go 和 tcp_hub.go 傻傻分不清

@RPRX RPRX changed the title Fix some json Config: Fix some issues Aug 27, 2026
@RPRX
RPRX merged commit 3af7f25 into main Aug 27, 2026
48 checks passed
Fangliding added a commit that referenced this pull request Aug 27, 2026
Jolymmiles added a commit to Jolymmiles/Xray-core that referenced this pull request Aug 27, 2026
Medium1992 pushed a commit to Medium1992/Xray-core-fork that referenced this pull request Sep 28, 2026
TaiLerV pushed a commit to TaiLerV/Xray-core-up that referenced this pull request Oct 6, 2026
@RPRX
RPRX deleted the uds-listen branch November 19, 2026 12:26
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

3 participants