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

Wireguard panic: runtime error: index out of range [-1] #3380

Closed
2 tasks done
0xland opened this issue May 22, 2024 · 7 comments
Closed
2 tasks done

Wireguard panic: runtime error: index out of range [-1] #3380

0xland opened this issue May 22, 2024 · 7 comments
Assignees

Comments

@0xland
Copy link
Contributor

0xland commented May 22, 2024

Integrity requirements

  • I confirm that I have read the documentation, understand the meaning of all the configuration items I wrote, and did not pile up seemingly useful options or default values.
  • I searched issues and did not find any similar issues.

Version

1.8.12

Description

WireGuard crashes immediately after receiving the first few requests.

Reproduction Method

Run xray-core version 1.8.12 with WireGuard as the outbound protocol.

Client config


{
    "log": {
        "logLevel": "warning"
    },
    "inbounds": [
        {
            "listen": "127.0.0.1",
            "port": 1080,
            "protocol": "socks",
            "settings": {
                "auth": "noauth",
                "udp": true
            },
            "sniffing": {
                "destOverride": ["http", "tls", "quic", "fakedns"],
                "enabled": false,
                "routeOnly": true
            },
            "tag": "socks"
        }
    ],
    "outbounds": [
        {
            "protocol": "wireguard",
            "tag": "proxy",
            "settings": {
                "secretKey": "",
                "address": [
                    "172.16.0.2/32",
                    "2606:4700:110:8ac2:46bf:9062:4022:75c1/128"
                ],
                "peers": [
                    {
                        "endpoint": "engage.cloudflare.com:2048",
                        "publicKey": "bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo="
                    }
                ],
                "mtu": 1280,
                "reserved": [67, 75, 203]
            }
        },
        {
            "protocol": "freedom",
            "tag": "direct"
        },
        {
            "protocol": "blackhole",
            "tag": "block"
        }
    ]
}

Server config


Client log


Xray 1.8.12 (Xray, Penetrates Everything.) 416f2df (go1.22.3 darwin/arm64)
A unified platform for anti-censorship.
2024/05/22 11:07:06 [Info] infra/conf/serial: Reading config: wireguard.json
2024/05/22 11:07:06 [Warning] core: Xray 1.8.12 started
2024/05/22 11:07:06 tcp:127.0.0.1:58563 accepted tcp:one.one.one.one:853 [socks >> proxy]
panic: runtime error: index out of range [-1]

goroutine 98 [running]:
github.com/xtls/xray-core/app/proxyman/outbound.(*Handler).Dial(0x14000388e80, {0x1016f9e70, 0x10206a920}, {{0x1016fa3e8, 0x14000385308}, 0x943, 0x3})
github.com/xtls/xray-core/app/proxyman/outbound/handler.go:288 +0xac8
github.com/xtls/xray-core/proxy/wireguard.(*netBindClient).connectTo(0x14000392690, 0x14000395620)
github.com/xtls/xray-core/proxy/wireguard/bind.go:131 +0x54
github.com/xtls/xray-core/proxy/wireguard.(*netBindClient).Send(0x14000392690, {0x140005067b0, 0x1, 0x10223e1d8?}, {0x1016fe998?, 0x14000395620})
github.com/xtls/xray-core/proxy/wireguard/bind.go:174 +0x54
golang.zx2c4.com/wireguard/device.(*Peer).SendBuffers(0x14000264308, {0x140005067b0, 0x1, 0x1})
golang.zx2c4.com/wireguard@v0.0.0-20231211153847-12269c276173/device/peer.go:136 +0x218
golang.zx2c4.com/wireguard/device.(*Peer).SendHandshakeInitiation(0x14000264308, 0x38?)
golang.zx2c4.com/wireguard@v0.0.0-20231211153847-12269c276173/device/send.go:136 +0x43c
golang.zx2c4.com/wireguard/device.(*Peer).SendStagedPackets(0x14000264308)
golang.zx2c4.com/wireguard@v0.0.0-20231211153847-12269c276173/device/send.go:350 +0xd4
golang.zx2c4.com/wireguard/device.(*Device).RoutineReadFromTUN(0x140001fec88)
golang.zx2c4.com/wireguard@v0.0.0-20231211153847-12269c276173/device/send.go:293 +0x694
created by golang.zx2c4.com/wireguard/device.NewDevice in goroutine 11
golang.zx2c4.com/wireguard@v0.0.0-20231211153847-12269c276173/device/device.go:322 +0x3e8

Server log


@hkint
Copy link

hkint commented May 22, 2024

same question,but 1.8.11 version works

@yuhan6665 yuhan6665 self-assigned this May 22, 2024
@yuhan6665
Copy link
Member

Can you help testing if it is fixed? https://github.com/XTLS/Xray-core/actions/runs/9191528834

@swxk521
Copy link

swxk521 commented May 22, 2024

Can you help testing if it is fixed? https://github.com/XTLS/Xray-core/actions/runs/9191528834

Xray-linux-64测试wireguard正常了

@yuhan6665
Copy link
Member

感谢大家高速反馈

@Fangliding
Copy link
Member

现在怎么办 修改一下git历史把修复移到1.8.12前面吗()

@yuhan6665
Copy link
Member

不搞魔法了 承认失败 稍候再发 .13

@Fangliding Fangliding pinned this issue May 22, 2024
@RPRX
Copy link
Member

RPRX commented May 23, 2024

@RPRX RPRX unpinned this issue May 23, 2024
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

6 participants