Skip to content

panic: runtime error: index out of range #719

@fghj0810

Description

@fghj0810

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

4.34.0

你的使用场景是什么?

测试

你看到的异常现象是什么?

无法启动

你期待看到的正常表现是怎样的?

正常启动

请附上你的配置

客户端配置:

{
    "log": {
        "loglevel": "info"
    },
    "dns": {
        "servers": [
            "114.114.114.114",
            {
                "address": "localhost",
                "port": 53,
                "domains": [
                    "geosite:cn"
                ]
            },
            "localhost"
        ],
        "tag": "dns-inbound"
    },
    "inbounds": [
        {
            "port": 10801,
            "listen": "127.0.0.1",
            "protocol": "socks",
            "settings": {
                "auth": "noauth"
            }
        }
    ],
    "outbounds": [
        {
            "protocol": "blackhole",
            "settings": {},
            "tag": "block"
        },
        {
            "protocol": "freedom",
            "settings": {},
            "tag": "direct"
        }
    ],
    "routing": {
        "domainStrategy": "IPIfNonMatch",
        "rules": [
            {
                "domain": [
                    "geosite:cn"
                ],
                "outboundTag": "direct",
                "type": "field"
            },
            {
                "ip": [
                    "geoip:private",
                    "geoip:cn"
                ],
                "outboundTag": "direct",
                "type": "field"
            }
        ]
    }
}

请附上出错时软件输出的错误日志

客户端错误日志:

V2Ray 4.34.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.15.6 windows/amd64)
A unified platform for anti-censorship.
2021/03/01 11:24:54 [Info] v2ray.com/core/main/jsonem: Reading config: test.json
2021/03/01 11:24:54 [Info] v2ray.com/core/app/dns: DNS: created UDP client inited for 114.114.114.114:53
2021/03/01 11:24:54 [Info] v2ray.com/core/app/dns: DNS: created localhost client
2021/03/01 11:24:54 [Info] v2ray.com/core/app/dns: DNS: created localhost client
panic: runtime error: index out of range [2982] with length 2982

goroutine 1 [running]:
v2ray.com/core/app/dns.New.func1(0x1900a60, 0xc00088c058, 0x0, 0x0, 0x1)
        v2ray.com/core/app/dns/dns.go:89 +0x9d
v2ray.com/core/app/dns.NewClient.func1(0x23a5f1ed9f8, 0xc000694580, 0x0, 0x0)
        v2ray.com/core/app/dns/nameserver.go:109 +0x3ec
reflect.Value.call(0x167fe40, 0xc00038fec0, 0x13, 0x17dc293, 0x4, 0xc00041e0a0, 0x1, 0x1, 0x1, 0x0, ...)
        reflect/value.go:476 +0x8e7
reflect.Value.Call(0x167fe40, 0xc00038fec0, 0x13, 0xc00041e0a0, 0x1, 0x1, 0x0, 0x1, 0x1)
        reflect/value.go:337 +0xc5
v2ray.com/core.(*resolution).resolve(0xc0000a3938, 0xc0006be580, 0x5, 0x8, 0x1, 0xc0003fe300, 0x0)
        v2ray.com/core/v2ray.go:74 +0x612
v2ray.com/core.(*Instance).RequireFeatures(0xc0005eddb0, 0x167fe40, 0xc00038fec0, 0x0, 0xc0000a39e8)
        v2ray.com/core/v2ray.go:281 +0x26f
v2ray.com/core.RequireFeatures(0x190bea0, 0xc000090600, 0x167fe40, 0xc00038fec0, 0x30, 0x0)
        v2ray.com/core/v2ray.go:155 +0x5e
v2ray.com/core/app/dns.NewClient(0x190bea0, 0xc000090600, 0xc0006bd4d0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc0003e0c60, ...)
        v2ray.com/core/app/dns/nameserver.go:72 +0x12f
v2ray.com/core/app/dns.New(0x190bea0, 0xc000090600, 0xc0001c3ea0, 0xa500023a39f307b0, 0x1, 0xc000200970)
        v2ray.com/core/app/dns/dns.go:101 +0x5b2
v2ray.com/core/app/dns.init.1.func1(0x190bea0, 0xc000090600, 0x177e240, 0xc0001c3ea0, 0xc0000a3c01, 0xd5e8bf, 0x30, 0x1762860)
        v2ray.com/core/app/dns/dns.go:251 +0x5b
v2ray.com/core/common.CreateObject(0x190bea0, 0xc000090600, 0x177e240, 0xc0001c3ea0, 0x171dfa0, 0xc0005eddb0, 0x190bea0, 0xc000090600)
        v2ray.com/core/common/type.go:32 +0x242
v2ray.com/core.CreateObject(0xc0005eddb0, 0x177e240, 0xc0001c3ea0, 0x0, 0x0, 0x1, 0x0)
        v2ray.com/core/functions.go:21 +0x58
v2ray.com/core.initInstanceWithConfig(0xc00027b560, 0xc0005eddb0, 0x0, 0x0, 0x1687401)
        v2ray.com/core/v2ray.go:196 +0xf2
v2ray.com/core.New(0xc00027b560, 0x4, 0xc00002a0f0, 0x9)
        v2ray.com/core/v2ray.go:164 +0x7f
main.startV2Ray(0xc00007c120, 0xc00007a050, 0x2, 0x3)
        v2ray.com/core/main/main.go:115 +0x30e
main.main()
        v2ray.com/core/main/main.go:139 +0xbf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions