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

从STDIN加载配置时crash #2936

Open
qianyimao opened this issue Mar 17, 2024 · 1 comment
Open

从STDIN加载配置时crash #2936

qianyimao opened this issue Mar 17, 2024 · 1 comment

Comments

@qianyimao
Copy link

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

从最新的源代码编译

你的使用场景是什么?

从stdin加载包含api配置的配置文件

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

当从stdin的配置文件中包含有api配置时,程序crash。如果不包含api配置则正常运行

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

使用stdin配置时,包含api的配置能正常工作

请附上你的配置

服务端配置:

// 在这里附上服务器端配置文件

客户端配置:

// 在这里附上客户端配置
{
    "api": {
        "services": [
            "HandlerService"
        ],
        "tag": "api"
    },
    "inbound": {
        "port": 10086,
        "protocol": "vmess",
        "settings": {
            "clients": [
                {
                    "alterId": 32,
                    "id": "fcecbd2b-3a34-4201-bd3d-7c67d89c26ba",
                    "level": 0
                }
            ]
        },
        "streamSettings": {
            "network": "tcp"
        },
        "tag": "proxy"
    },
    "inboundDetour": [
        {
            "listen": "127.0.0.1",
            "port": 10085,
            "protocol": "dokodemo-door",
            "settings": {
                "address": "127.0.0.1"
            },
            "tag": "api"
        }
    ],
    "log": {
        "loglevel": "debug"
    },
    "outbound": {
        "protocol": "freedom",
        "settings": {}
    },
    "routing": {
        "settings": {
            "rules": [
                {
                    "inboundTag": [
                        "api"
                    ],
                    "outboundTag": "api",
                    "type": "field"
                }
            ]
        },
        "strategy": "rules"
    }
}

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

服务器端错误日志:

// 在这里附上服务器端日志

客户端错误日志:

// 在这里附上客户端日志

V2Ray 5.15.1 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.22.1 windows/amd64)
A unified platform for anti-censorship.
2024/03/17 16:23:10 Using config from STDIN
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0xd8 pc=0x1052b1e]

goroutine 1 [running]:
github.com/v2fly/v2ray-core/v5/infra/conf/v2jsonpb.(*V2JsonProtobufFollowerFieldDescriptor).Number(0x0?)
        <autogenerated>:1 +0x1e
google.golang.org/protobuf/encoding/protojson.decoder.unmarshalMessage({0xc000151680, {{}, 0x1, 0x0, {0x1616898, 0xc0001f6da0}, 0x270f}}, {0x1629b78, 0xc0001f6db0}, 0x0)
        google.golang.org/protobuf@v1.33.0/encoding/protojson/decode.go:213 +0x870
google.golang.org/protobuf/encoding/protojson.UnmarshalOptions.unmarshal({{}, 0x1, 0x0, {0x1616898, 0xc0001f6da0}, 0x2710}, {0xc000268000, 0x4fe, 0x4fe}, {0x1607800, ...})
        google.golang.org/protobuf@v1.33.0/encoding/protojson/decode.go:80 +0x1bc
google.golang.org/protobuf/encoding/protojson.UnmarshalOptions.Unmarshal(...)
        google.golang.org/protobuf@v1.33.0/encoding/protojson/decode.go:63
github.com/v2fly/v2ray-core/v5/infra/conf/v2jsonpb.loadV2JsonPb({0xc000268000, 0x4fe, 0x4fe})
        github.com/v2fly/v2ray-core/v5/infra/conf/v2jsonpb/v2jsonpb.go:21 +0x196
github.com/v2fly/v2ray-core/v5/infra/conf/v2jsonpb.init.0.func1({0x111a500?, 0xc000125158?})
        github.com/v2fly/v2ray-core/v5/infra/conf/v2jsonpb/v2jsonpb.go:60 +0xb8
github.com/v2fly/v2ray-core/v5.loadSingleConfigByTryingAllLoaders({0x111a500, 0xc000125158})
        github.com/v2fly/v2ray-core/v5/config.go:174 +0xa2
github.com/v2fly/v2ray-core/v5.loadSingleConfigAutoFormat({0x13addc0?, 0xc00006e050?})
        github.com/v2fly/v2ray-core/v5/config.go:148 +0x14c
github.com/v2fly/v2ray-core/v5.LoadConfig({0x13cb3ee, 0x4}, {0x11527c0, 0x2714160})
        github.com/v2fly/v2ray-core/v5/config.go:110 +0x125
github.com/v2fly/v2ray-core/v5/main/commands.startV2Ray()
        github.com/v2fly/v2ray-core/v5/main/commands/run.go:194 +0x4c
github.com/v2fly/v2ray-core/v5/main/commands.executeRun(0x2148580, {0xc00007e0a0, 0x1, 0x2})
        github.com/v2fly/v2ray-core/v5/main/commands/run.go:81 +0xbf
github.com/v2fly/v2ray-core/v5/main/commands/base.Execute()
        github.com/v2fly/v2ray-core/v5/main/commands/base/execute.go:67 +0x63d
main.main()
        github.com/v2fly/v2ray-core/v5/main/main.go:16 +0x285

请附上访问日志

// 在这里附上服务器端日志

其它相关的配置文件(如 Nginx)和相关日志

如果 V2Ray 无法启动,请附上 --test 命令的输出

如果 V2Ray 服务运行异常,请附上 journal 日志

@2366621450
Copy link

5.15.3版本出现同样的问题...

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

No branches or pull requests

2 participants