Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.27.4在dns.servers设置为空数组的情况下会崩溃 #146

Closed
yyjdelete opened this issue Aug 31, 2020 · 2 comments · Fixed by #148
Closed

4.27.4在dns.servers设置为空数组的情况下会崩溃 #146

yyjdelete opened this issue Aug 31, 2020 · 2 comments · Fixed by #148

Comments

@yyjdelete
Copy link

除非特殊情况,请完整填写所有问题。不按模板发的 issue 将直接被关闭。
如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚要如何配置,请使用Discussion进行讨论。

  1. 你正在使用哪个版本的 V2Ray?

4.27.4(4.27.0正常)

  1. 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。

访问任何需要dns的网站

  1. 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等)

panic

  1. 你期待看到的正确表现是怎样的?

和4.27.0以及未设置dns的时候一样, 回退到使用系统dns.
不要问我为啥设置空数组, qv2ray的客户端是这么干的

  1. 请附上你的配置(提交 Issue 前请隐藏服务器端IP地址)。

客户端配置:

{
    "dns": {
        "servers": [
        ]
    },
...
}
  1. 请附上出错时软件输出的错误日志。在 Linux 中,日志通常在 /var/log/v2ray/error.log 文件中。

客户端错误日志:

panic: runtime error: index out of range [0] with length 0

goroutine 66 [running]:
v2ray.com/core/app/dns.(*Server).Match(0xc000219ef0, 0x0, 0xef1f40, 0xc0000aa0a8, 0xc00084a590, 0xa, 0xc0034d6200, 0x1, 0x1, 0x0, ...)
        v2ray.com/core/app/dns/server.go:259 +0x830
v2ray.com/core/app/dns.(*Server).queryIPTimeout(0xc000219ef0, 0x0, 0xef1f40, 0xc0000aa0a8, 0xc00084a590, 0xa, 0x101, 0x800, 0x800, 0xd0bf80, ...)
        v2ray.com/core/app/dns/server.go:296 +0x1ff
v2ray.com/core/app/dns.(*Server).lookupIPInternal(0xc000219ef0, 0xc00084a590, 0xa, 0x101, 0xc0042c3b70, 0x66, 0xffffffffffffffff, 0x0, 0x0)
        v2ray.com/core/app/dns/server.go:411 +0x85d
v2ray.com/core/app/dns.(*Server).LookupIP(0xc000219ef0, 0xc00084a590, 0xa, 0xc001eae8e0, 0x9b1351, 0xc00084a590, 0xc0042c3b50, 0x9b0e00)
        v2ray.com/core/app/dns/server.go:302 +0x4d
v2ray.com/core/app/router.(*Context).GetTargetIPs(0xc0023c2960, 0x0, 0x0, 0x0)
        v2ray.com/core/app/router/router.go:161 +0x1e0
v2ray.com/core/app/router.getIPsFromTarget(0xc0023c2960, 0x0, 0x0, 0x153a770)
        v2ray.com/core/app/router/condition.go:112 +0x32
v2ray.com/core/app/router.(*MultiGeoIPMatcher).Apply(0xc0000a89e0, 0xc0023c2960, 0xc0042c3d00)
        v2ray.com/core/app/router/condition.go:144 +0x45
v2ray.com/core/app/router.(*ConditionChan).Apply(0xc0000a89a0, 0xc0023c2960, 0xed2900)
        v2ray.com/core/app/router/condition.go:33 +0x76
v2ray.com/core/app/router.(*Rule).Apply(...)
        v2ray.com/core/app/router/config.go:63
v2ray.com/core/app/router.(*Router).pickRouteInternal(0xc000256140, 0xf00a00, 0xc0023d1740, 0xed28c0, 0xca1980, 0xc000256300)
        v2ray.com/core/app/router/router.go:115 +0x317
v2ray.com/core/app/router.(*Router).PickRoute(0xc000256140, 0xf00a00, 0xc0023d1740, 0xca1980, 0xc000256300, 0x10, 0xc00005a300)
        v2ray.com/core/app/router/router.go:78 +0x4a
v2ray.com/core/app/dispatcher.(*DefaultDispatcher).routedDispatch(0xc0002562c0, 0xf00a00, 0xc0023d1740, 0xc001a1a620, 0xf01d00, 0xc00005a300, 0x2000001bb)
        v2ray.com/core/app/dispatcher/default.go:268 +0x3e3
v2ray.com/core/app/dispatcher.(*DefaultDispatcher).Dispatch.func1(0xc001a1a620, 0xf00a00, 0xc0023d1740, 0xc000256300, 0xc00426e840, 0x2, 0x2, 0x1, 0xc001a1a520, 0xc000257100, ...)
        v2ray.com/core/app/dispatcher/default.go:223 +0x149
created by v2ray.com/core/app/dispatcher.(*DefaultDispatcher).Dispatch
        v2ray.com/core/app/dispatcher/default.go:208 +0x2ea
  1. 请附上访问日志。在 Linux 中,日志通常在 /var/log/v2ray/access.log 文件中。
    // 在这里附上服务器端日志
  1. 其它相关的配置文件(如 Nginx)和相关日志。

  2. 如果 V2Ray 无法启动,请附上 --test 输出。

通常的命令为 /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json。请按实际情况修改。

  1. 如果 V2Ray 服务运行不正常,请附上 journal 日志。

通常的命令为 journalctl -u v2ray

请预览一下你填的内容再提交。

@Loyalsoldier
Copy link
Contributor

ping @Vigilans

@Vigilans
Copy link
Contributor

Sorry for my fault...

I changed ipIndexMap from map to slice just for code consistency with DNS clients array, but failed to inspect my change carefully with enough bound check.

@kslr kslr closed this as completed in #148 Aug 31, 2020
Vigilans added a commit to Vigilans/v2ray-core that referenced this issue Aug 31, 2020
Vigilans added a commit to Vigilans/v2ray-core that referenced this issue Aug 31, 2020
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 a pull request may close this issue.

3 participants