v2ray-core icon indicating copy to clipboard operation
v2ray-core copied to clipboard

panic: crypto/cipher: invalid buffer overlap

Open Steven-X97 opened this issue 10 months ago • 27 comments

v2ray version:V2Ray 5.10.0 go version: 1.20

I refer to v2ray in a golang project written by myself, which runs on the Debian11 machine. Since February 12, the project has encountered a running exception. The exception log is "panic: runtime error: Slice bounds out of range [: 2239] with capacity of 2048 ", the problem and the same in the https://github.com/v2fly/v2ray-core/issues/3303, And then found the solution from the https://github.com/v2fly/v2ray-core/issues/3303#issuecomment-2661456596, due to the inconvenience v2ray version upgrade to v5.29.0 directly in the project, So can only refer to [v5.29.0] (https://github.com/v2fly/v2ray-core/releases/tag/v5.29.0) commit the code change, synchronous change their projects v2ray source; The modified project solves the above problem, but as long as you use the Chrome133.x.x.x browser to access the website, an exception will occur, and the exception log is as follows:

panic: crypto/cipher: invalid buffer overlap

goroutine 12830 [running]: crypto/aes.(*gcmAsm).Seal(0xc002e877c0, {0xc000da2802, 0x0, 0x7fe}, {0xc000965510?, 0x2?, 0xc0021ebc40?}, {0xc000da2800, 0x4e2, 0x800}, ...) /Go/go1.20/src/crypto/aes/aes_gcm.go:118 +0x4f8 github.com/v2fly/v2ray-core/v5/common/crypto.(*AEADAuthenticator).Seal(0xc001ddf5c0, {0xc000da2802, 0x0, 0x7fe}, {0xc000da2800, 0x4e2, 0x800}) /go/pkg/mod/github.com/v2fly/v2ray-core/[email protected]/common/crypto/auth.go:83 +0x12f github.com/v2fly/v2ray-core/v5/common/crypto.(*AuthenticationWriter).seal(0xc002c9b680, {0xc000da2800, 0x4e2, 0x800}) /go/pkg/mod/github.com/v2fly/v2ray-core/[email protected]/common/crypto/auth.go:260 +0x344 github.com/v2fly/v2ray-core/v5/common/crypto.(*AuthenticationWriter).writePacket(0xc002c9b680, {0xc003333cf8, 0x3, 0x7fd254939301?}) /go/pkg/mod/github.com/v2fly/v2ray-core/[email protected]/common/crypto/auth.go:326 +0x233 github.com/v2fly/v2ray-core/v5/common/crypto.(*AuthenticationWriter).WriteMultiBuffer(0xc0015e8ab0?, {0xc003333cf8?, 0xc0015e8ab0?, 0xe79c20?}) /go/pkg/mod/github.com/v2fly/v2ray-core/[email protected]/common/crypto/auth.go:353 +0x5f github.com/v2fly/v2ray-core/v5/common/buf.CopyOnceTimeout({0x191e1a0?, 0xc0015e8ab0?}, {0x191f4c0, 0xc002c9b680}, 0xc0021ebe98?) /go/pkg/mod/github.com/v2fly/v2ray-core/[email protected]/common/buf/copy.go:122 +0x8e github.com/v2fly/v2ray-core/v5/proxy/vmess/outbound.(*Handler).Process.func2() /go/pkg/mod/github.com/v2fly/v2ray-core/[email protected]/proxy/vmess/outbound/outbound.go:156 +0x5b4 github.com/v2fly/v2ray-core/v5/common/task.Run.func1(0xc000410d20?) /go/pkg/mod/github.com/v2fly/v2ray-core/[email protected]/common/task/task.go:28 +0x2e created by github.com/v2fly/v2ray-core/v5/common/task.Run /go/pkg/mod/github.com/v2fly/v2ray-core/[email protected]/common/task/task.go:27 +0xde

Steven-X97 avatar Feb 17 '25 13:02 Steven-X97

save here with version 5.29.0

V2Ray 5.29.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.23.6 linux/amd64)
A unified platform for anti-censorship.
panic: crypto/cipher: invalid buffer overlap
goroutine 48861 [running]:
crypto/aes.(*gcmAsm).Seal(0xc002568000, {0xc000400002, 0x0, 0x7fe}, {0xc002b48370?, 0xc0020341e0?, 0xc0020d1a98?},>
        crypto/aes/aes_gcm.go:118 +0x4c5
github.com/v2fly/v2ray-core/v5/common/crypto.(*AEADAuthenticator).Seal(0xc0010c73a0, {0xc000400002, 0x0, 0x7fe}, {>
        github.com/v2fly/v2ray-core/v5/common/crypto/auth.go:83 +0x127
github.com/v2fly/v2ray-core/v5/common/crypto.(*AuthenticationWriter).seal(0xc0012774f0, {0xc000400000, 0x766, 0x80>
        github.com/v2fly/v2ray-core/v5/common/crypto/auth.go:266 +0x323
github.com/v2fly/v2ray-core/v5/common/crypto.(*AuthenticationWriter).writeStream(0xc0012774f0, {0xc00200ec48, 0x3,>
        github.com/v2fly/v2ray-core/v5/common/crypto/auth.go:304 +0x3ea
github.com/v2fly/v2ray-core/v5/common/crypto.(*AuthenticationWriter).WriteMultiBuffer(0x1?, {0xc00200ec48?, 0xc003>
        github.com/v2fly/v2ray-core/v5/common/crypto/auth.go:356 +0x50
github.com/v2fly/v2ray-core/v5/common/buf.copyInternal({0x193fd20, 0xc003207610}, {0x1941220, 0xc0012774f0}, 0xc00>
        github.com/v2fly/v2ray-core/v5/common/buf/copy.go:87 +0x15d
github.com/v2fly/v2ray-core/v5/common/buf.Copy({0x193fd20, 0xc003207610}, {0x1941220, 0xc0012774f0}, {0xc0020d1e30>
        github.com/v2fly/v2ray-core/v5/common/buf/copy.go:104 +0x98
github.com/v2fly/v2ray-core/v5/proxy/vmess/inbound.transferResponse({0x1940da0, 0xc0012a1b60}, 0xc000457650, 0xc00>
        github.com/v2fly/v2ray-core/v5/proxy/vmess/inbound/inbound.go:203 +0x226
github.com/v2fly/v2ray-core/v5/proxy/vmess/inbound.(*Handler).Process.func2()
        github.com/v2fly/v2ray-core/v5/proxy/vmess/inbound/inbound.go:312 +0x2c9
github.com/v2fly/v2ray-core/v5/common/task.Run.func1(0xc0024961e0?)
        github.com/v2fly/v2ray-core/v5/common/task/task.go:28 +0x28
created by github.com/v2fly/v2ray-core/v5/common/task.Run in goroutine 48858
        github.com/v2fly/v2ray-core/v5/common/task/task.go:27 +0xdb


lucfiar avatar Feb 18 '25 05:02 lucfiar

Would you mind sharing your configuration files for both client and server? It seems the issue is caused by https://github.com/v2fly/v2ray-core/blob/master/common/crypto/auth.go#L266 .

xiaokangwang avatar Feb 18 '25 14:02 xiaokangwang

服务器错误

Feb 19 04:35:13 localhost v2ray[973731]: V2Ray 5.29.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.23.6 linux/amd64)
Feb 19 04:35:13 localhost v2ray[973731]: A unified platform for anti-censorship.
Feb 19 09:38:44 localhost v2ray[973731]: panic: crypto/cipher: invalid buffer overlap
Feb 19 09:38:44 localhost v2ray[973731]: goroutine 62089 [running]:
Feb 19 09:38:44 localhost v2ray[973731]: crypto/aes.(*gcmAsm).Seal(0xc000952b40, {0xc00078c802, 0x0, 0x7fe}, {0xc00b070f70?, 0x2?, 0xc0007c5b80?}, {0xc>
Feb 19 09:38:44 localhost v2ray[973731]:         crypto/aes/aes_gcm.go:118 +0x4c5
Feb 19 09:38:44 localhost v2ray[973731]: github.com/v2fly/v2ray-core/v5/common/crypto.(*AEADAuthenticator).Seal(0xc000d7a5c0, {0xc00078c802, 0x0, 0x7fe>
Feb 19 09:38:44 localhost v2ray[973731]:         github.com/v2fly/v2ray-core/v5/common/crypto/auth.go:83 +0x127
Feb 19 09:38:44 localhost v2ray[973731]: github.com/v2fly/v2ray-core/v5/common/crypto.(*AuthenticationWriter).seal(0xc00095a6e0, {0xc00078c800, 0x7ae, >
Feb 19 09:38:44 localhost v2ray[973731]:         github.com/v2fly/v2ray-core/v5/common/crypto/auth.go:266 +0x323
Feb 19 09:38:44 localhost v2ray[973731]: github.com/v2fly/v2ray-core/v5/common/crypto.(*AuthenticationWriter).writeStream(0xc00095a6e0, {0xc00005dc90, >
Feb 19 09:38:44 localhost v2ray[973731]:         github.com/v2fly/v2ray-core/v5/common/crypto/auth.go:304 +0x3ea
Feb 19 09:38:44 localhost v2ray[973731]: github.com/v2fly/v2ray-core/v5/common/crypto.(*AuthenticationWriter).WriteMultiBuffer(0xc000c70230?, {0xc00005>
Feb 19 09:38:44 localhost v2ray[973731]:         github.com/v2fly/v2ray-core/v5/common/crypto/auth.go:356 +0x50
Feb 19 09:38:44 localhost v2ray[973731]: github.com/v2fly/v2ray-core/v5/proxy/vmess/inbound.transferResponse({0x1940da0, 0xc000c63170}, 0xc000c70230, 0>
Feb 19 09:38:44 localhost v2ray[973731]:         github.com/v2fly/v2ray-core/v5/proxy/vmess/inbound/inbound.go:194 +0x1a2
Feb 19 09:38:44 localhost v2ray[973731]: github.com/v2fly/v2ray-core/v5/proxy/vmess/inbound.(*Handler).Process.func2()
Feb 19 09:38:44 localhost v2ray[973731]:         github.com/v2fly/v2ray-core/v5/proxy/vmess/inbound/inbound.go:312 +0x2c9
Feb 19 09:38:44 localhost v2ray[973731]: github.com/v2fly/v2ray-core/v5/common/task.Run.func1(0xc000590690?)
Feb 19 09:38:44 localhost v2ray[973731]:         github.com/v2fly/v2ray-core/v5/common/task/task.go:28 +0x28
Feb 19 09:38:44 localhost v2ray[973731]: created by github.com/v2fly/v2ray-core/v5/common/task.Run in goroutine 62086
Feb 19 09:38:44 localhost v2ray[973731]:         github.com/v2fly/v2ray-core/v5/common/task/task.go:27 +0xdb
Feb 19 09:38:44 localhost systemd[1]: v2ray.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Feb 19 09:38:44 localhost systemd[1]: v2ray.service: Failed with result 'exit-code'.

服务器配置

{
    "log": {
        "access": "none",
        "error": "/var/log/v2ray/error.log",
        "loglevel": "warning"
    },
    "inbounds": [
        {
            "port": xxxxx,
            "listen": "0.0.0.0",
            "tag": "socks-inbound",
            "protocol": "vmess",
            "settings": {
                "clients": [
                    {
                        "id": "xxxx-xxx-xxx-xxx-xxxx",
                        "alterId": 4,
                        "security": "aes-128-gcm"
                    }
                ]
            },
            "sniffing": {
                "enabled": true,
                "destOverride": [
                    "http",
                    "tls"
                ]
            }
        }
    ],
    "outbounds": [
        {
            "protocol": "freedom",
            "settings": {},
            "tag": "direct"
        },
        {
            "protocol": "blackhole",
            "settings": {},
            "tag": "blocked"
        }
    ],
    "routing": {
        "domainStrategy": "IPOnDemand",
        "rules": [
            {
                "type": "field",
                "ip": [
                    "geoip:private"
                ],
                "outboundTag": "blocked"
            },
            {
                "type": "field",
                "domain": [
                    "geosite:category-ads"
                ],
                "outboundTag": "blocked"
            }
        ]
    },
    "dns": {
        "hosts": {
            "domain:v2fly.org": "www.vicemc.net",
            "domain:github.io": "pages.github.com",
            "domain:wikipedia.org": "www.wikimedia.org",
            "domain:shadowsocks.org": "electronicsrealm.com"
        },
        "servers": [
            "1.1.1.1",
            {
                "address": "114.114.114.114",
                "port": 53,
                "domains": [
                    "geosite:cn"
                ]
            },
            "8.8.8.8",
            "localhost"
        ]
    },
    "policy": {
        "levels": {
            "0": {
                "uplinkOnly": 0,
                "downlinkOnly": 0
            }
        },
        "system": {
            "statsInboundUplink": false,
            "statsInboundDownlink": false,
            "statsOutboundUplink": false,
            "statsOutboundDownlink": false
        }
    },
    "other": {}
}

客户端有很多, 以下只是其中一个, 不一定是这个客户端引起的

{
    "outbounds": [
        {
            "mux": {
                "enabled": false
            },
            "protocol": "vmess",
            "settings": {
                "vnext": [
                    {
                        "port": xxxxxx,
                        "users": [
                            {
                                "encryption": "none",
                                "id": "xxxx-xxxx-xxxx-xxxx-xxxx",
                                "level": 0,
                                "security": "none"
                            }
                        ],
                        "address": "server ip "
                    }
                ]
            },
            "streamSettings": {
                "network": "tcp",
                "rawSettings": {
                    "header": {
                        "type": "none"
                    }
                },
                "sockopt": {
                    "mark": 255
                }
            },
            "tag": "QZKzgOJV:xxxxx"
        },
        {
            "streamSettings": {
                "sockopt": {
                    "mark": 255
                }
            },
            "settings": {
                "domainStrategy": "UseIP"
            },
            "protocol": "freedom",
            "tag": "direct"
        },
        {
            "protocol": "blackhole",
            "tag": "blackhole"
        }
    ],

@xiaokangwang

selboo avatar Feb 19 '25 03:02 selboo

Would you mind sharing your configuration files for both client and server? It seems the issue is caused by https://github.com/v2fly/v2ray-core/blob/master/common/crypto/auth.go#L266 .

Yes, I read the log analysis, it is the problem in this place, but do not know how to fix it; There is no change in the configuration of my client and server, which was normal before use, and is normal now with other browsers, but this problem will definitely occur as long as I use Chrome. I checked that my Chrome browser was automatically updated to version 133 two days ago. Suspicion may have something to do with the Chrome update.

Steven-X97 avatar Feb 19 '25 03:02 Steven-X97

I also encountered this issue in recent days (prior to v5.29.0 released):

panic: crypto/cipher: invalid buffer overlap

goroutine 25 [running]:
crypto/aes.(*gcmAsm).Seal(0xc0001368c0, {0xc001567012, 0x0, 0x7ee}, {0xc002280140?, 0xc001567000?, 0x0?}, {0xc001567000, 0x168, 0x800}, ...)
        crypto/aes/aes_gcm.go:118 +0x4c5
github.com/v2fly/v2ray-core/v5/common/crypto.(*AEADAuthenticator).Seal(0xc00b3f0240, {0xc001567012, 0x0, 0x7ee}, {0xc001567000, 0x168, 0x800})
        github.com/v2fly/v2ray-core/v5/common/crypto/auth.go:83 +0x127
github.com/v2fly/v2ray-core/v5/common/crypto.(*AuthenticationWriter).seal(0xc00301f1d0, {0xc001567000, 0x168, 0x800})
        github.com/v2fly/v2ray-core/v5/common/crypto/auth.go:266 +0x323
github.com/v2fly/v2ray-core/v5/common/crypto.(*AuthenticationWriter).writeStream(0xc00301f1d0, {0xc0011c33e8, 0x1, 0x1})
        github.com/v2fly/v2ray-core/v5/common/crypto/auth.go:304 +0x3eb
github.com/v2fly/v2ray-core/v5/common/crypto.(*AuthenticationWriter).WriteMultiBuffer(0x1?, {0xc0011c33e8?, 0xc002cf43f8?, 0xc000fe1de0?})
        github.com/v2fly/v2ray-core/v5/common/crypto/auth.go:356 +0x50
github.com/v2fly/v2ray-core/v5/common/buf.copyInternal({0x179d100, 0xc002cf4228}, {0x179e560, 0xc00301f1d0}, 0xc00b4f31d0)
        github.com/v2fly/v2ray-core/v5/common/buf/copy.go:87 +0x164
github.com/v2fly/v2ray-core/v5/common/buf.Copy({0x179d100, 0xc002cf4228}, {0x179e560, 0xc00301f1d0}, {0xc000fe1f48, 0x1, 0xc?})
        github.com/v2fly/v2ray-core/v5/common/buf/copy.go:104 +0x98
github.com/v2fly/v2ray-core/v5/proxy/shadowsocks.(*Server).handleConnection.func1()
        github.com/v2fly/v2ray-core/v5/proxy/shadowsocks/server.go:246 +0x3df
github.com/v2fly/v2ray-core/v5/common/task.Run.func1(0x11?)
        github.com/v2fly/v2ray-core/v5/common/task/task.go:28 +0x28
created by github.com/v2fly/v2ray-core/v5/common/task.Run in goroutine 22
        github.com/v2fly/v2ray-core/v5/common/task/task.go:27 +0xdb

My current v2ray-core branch is based on v5.13.0 upstream tag.

Vigilans avatar Feb 19 '25 13:02 Vigilans

Please try again with https://github.com/v2fly/v2ray-core/releases/tag/v5.29.1 see to if this issue has been fixed.

xiaokangwang avatar Feb 21 '25 22:02 xiaokangwang

in 5.29.1 this issue still exist

025/02/23 17:16:57.574 [I] [io.go:431] panic: crypto/cipher: invalid buffer overlap
....
2025/02/23 17:16:57.574 [I] [io.go:431] github.com/v2fly/v2ray-core/v5/common/task/task.go:28 +0x28
2025/02/23 17:16:57.574 [I] [io.go:431] created by github.com/v2fly/v2ray-core/v5/common/task.Run in goroutine 4768
2025/02/23 17:16:57.574 [I] [io.go:431] github.com/v2fly/v2ray-core/v5/common/task/task.go
2025/02/23 17:16:57.574 [I] [io.go:431] :27 +0xdb
2025/02/23 17:16:57.584 [W] [asm_amd64.s:1700] v2ray-core: exit status 2
2025/02/23 17:18:26.068 [I] [io.go:431] V2Ray 5.29.1 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.23.6 linux/amd64)
2025/02/23 17:18:26.068 [I] [io.go:431] A unified platform for anti-censorship.

1260zqs avatar Feb 23 '25 09:02 1260zqs

in 5.29.1 this issue still exist

025/02/23 17:16:57.574 [I] [io.go:431] panic: crypto/cipher: invalid buffer overlap
....
2025/02/23 17:16:57.574 [I] [io.go:431] github.com/v2fly/v2ray-core/v5/common/task/task.go:28 +0x28
2025/02/23 17:16:57.574 [I] [io.go:431] created by github.com/v2fly/v2ray-core/v5/common/task.Run in goroutine 4768
2025/02/23 17:16:57.574 [I] [io.go:431] github.com/v2fly/v2ray-core/v5/common/task/task.go
2025/02/23 17:16:57.574 [I] [io.go:431] :27 +0xdb
2025/02/23 17:16:57.584 [W] [asm_amd64.s:1700] v2ray-core: exit status 2
2025/02/23 17:18:26.068 [I] [io.go:431] V2Ray 5.29.1 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.23.6 linux/amd64)
2025/02/23 17:18:26.068 [I] [io.go:431] A unified platform for anti-censorship.

Can you paste the full stacktrace for it?

Vigilans avatar Feb 23 '25 10:02 Vigilans

in 5.29.1 this issue still exist

025/02/23 17:16:57.574 [I] [io.go:431] panic: crypto/cipher: invalid buffer overlap
....
2025/02/23 17:16:57.574 [I] [io.go:431] github.com/v2fly/v2ray-core/v5/common/task/task.go:28 +0x28
2025/02/23 17:16:57.574 [I] [io.go:431] created by github.com/v2fly/v2ray-core/v5/common/task.Run in goroutine 4768
2025/02/23 17:16:57.574 [I] [io.go:431] github.com/v2fly/v2ray-core/v5/common/task/task.go
2025/02/23 17:16:57.574 [I] [io.go:431] :27 +0xdb
2025/02/23 17:16:57.584 [W] [asm_amd64.s:1700] v2ray-core: exit status 2
2025/02/23 17:18:26.068 [I] [io.go:431] V2Ray 5.29.1 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.23.6 linux/amd64)
2025/02/23 17:18:26.068 [I] [io.go:431] A unified platform for anti-censorship.

Can you paste the full stacktrace for it?

Image

1260zqs avatar Feb 23 '25 10:02 1260zqs

there is my server config in gui Image

1260zqs avatar Feb 23 '25 10:02 1260zqs

@Vigilans I have a guess of what went wrong: at https://github.com/v2fly/v2ray-core/blob/4144c87fc1348ea2e51c0b948fea5a1577bae1a2/common/protocol/quic/sniff.go#L54-L55

The quic sniffer allocate a buffer(%1) and deferred its release(release %1).

https://github.com/v2fly/v2ray-core/blob/4144c87fc1348ea2e51c0b948fea5a1577bae1a2/common/protocol/quic/sniff.go#L234-L235 When its size is not sufficient, the cryptoData buffer is released early, and its value is overwrite with a new buffer(%2)

When the function ends, the deferred release %1 is executed again.

as a result, buffer %1 get released twice, and buffer %2 get released 0 time.

The key issue here is that when a function call get deferred, its argument may or may not get a snapshot of the the value passed in: https://go.dev/play/p/F_--epRl2yG .

If my assessment is correct, I would like to request you rewrite all the code in the quic pull request where the argument of the deferred value get modified: https://github.com/v2fly/v2ray-core/blob/4144c87fc1348ea2e51c0b948fea5a1577bae1a2/common/protocol/quic/sniff.go#L235

(the argument passed in was deferred for release in its call stack) https://github.com/v2fly/v2ray-core/blob/4144c87fc1348ea2e51c0b948fea5a1577bae1a2/app/dispatcher/default.go#L50

If you do not have the time to rewrite them all I could take over from here.

xiaokangwang avatar Feb 25 '25 18:02 xiaokangwang

@xiaokangwang For reference:

https://stackoverflow.com/questions/41471236/data-passed-by-reference-to-defer

So cryptoData is just copy-by value on deferring...that also means https://github.com/v2fly/v2ray-core/pull/3320 does not help in terms of buffer release issue because cache is properly released actually.

According to your investigation, we may be able to observe buffer's release status and find out the root cause with some logging. I don't have time to rewrite the code until this weekend.

Possible solutions:

  1. Call defer on each reallocation of buffer
  2. Change defer to something like defer func() { fmt.Printf("%#v\n", user) }()

Vigilans avatar Feb 26 '25 06:02 Vigilans

@Vigilans I believe #3320 might have helped, considering that the copy could be a shallow copy. So when the argument is a pointer to a struct, when it field in that struct changes, the new value would be received by the deferred call. On the other hand, when the argument is a value itself, like a []byte or int, then the value itself would not be changed.

I think in both case we should just use buf to allocate a buffer sufficiently big to avoid the need to reallocate it, and return an error if that is not sufficient. Since the buffer is in the pool, there won't be too much memory waste about this.

xiaokangwang avatar Feb 26 '25 13:02 xiaokangwang

If that is the case,

changing https://github.com/v2fly/v2ray-core/blob/4144c87fc1348ea2e51c0b948fea5a1577bae1a2/app/dispatcher/default.go#L253 to

defer func() {
	payload.Release()
}()

and https://github.com/v2fly/v2ray-core/blob/4144c87fc1348ea2e51c0b948fea5a1577bae1a2/common/protocol/quic/sniff.go#L55 to

defer func() {
	bytespool.Free(cryptoData)
}()

should be enough to prevent the crash. Why not let the affected users do some testing to investigate the root cause before making a real fix?

dyhkwong avatar Feb 26 '25 16:02 dyhkwong

should be enough to prevent the crash. Why not let the affected users do some testing to investigate the root cause before making a real fix?

I think your suggestion makes sense. I will write a temporary fix first and let everyone try it out.

xiaokangwang avatar Feb 27 '25 13:02 xiaokangwang

I have released a new version with a temporary fix for this issue, please have a try: https://github.com/v2fly/v2ray-core/releases/tag/v5.29.2

xiaokangwang avatar Feb 27 '25 15:02 xiaokangwang

I have not heard any complaint about crashes. So this patch works?

xiaokangwang avatar Mar 12 '25 20:03 xiaokangwang

稳定运行一周, 无异常.

● v2ray.service - V2Ray Service
     Loaded: loaded (/etc/systemd/system/v2ray.service; enabled; preset: disabled)
     Active: active (running) since Fri 2025-02-28 21:44:04 CST; 1 week 5 days ago
       Docs: https://www.v2fly.org/
   Main PID: 1165786 (v2ray)

# /usr/local/bin/v2ray version
V2Ray 5.29.2 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.23.6 linux/amd64)
A unified platform for anti-censorship.

selboo avatar Mar 13 '25 02:03 selboo

Some ssh seems to do not work on v5.29.2 with "dokodemo-door" inbound. I met this with the command ssh-keyscan -t rsa github.com and I got empty response, then I tried to telnet the github.com and got below response. There are no ssh server info.

telnet github.com 22                                                                                                 
Trying 20.205.243.166...
Connected to github.com.
Escape character is '^]'.

But, If I tried ssh [email protected], and I got the host key and the ssh server response (the denied response, and it is correct).

I have fallen back to "v5.28.0", I could get host key response from the "ssh-keyscan", and "telnet" has the different response.

telnet github.com 22                                                                                                 
Trying 20.205.243.166...
Connected to github.com.
Escape character is '^]'.
SSH-2.0-7d0489107

And the ssh [email protected] still works like above.

My testing version

client server result
v5.25.1 v5.25.1 :white_check_mark:
v5.25.1 v5.28.0 :white_check_mark:
v5.25.1 v5.29.2 :white_check_mark:
v5.28.0 v5.28.0 :white_check_mark:
v5.28.0 v5.29.2 :white_check_mark:
v5.29.2 v5.28.0 :x:
v5.29.2 v5.29.2 :x:

My dokodemo-door inbound

        {
            "tag": "transparent",
            "port": 1081,
            "protocol": "dokodemo-door",
            "settings": {
                "followRedirect": true,
                "network": "tcp,udp",
                "userLevel": 0
            },
            "sniffing": {
                "enabled": true,
                "destOverride": [
                    "http",
                    "tls"
                ]
            },
            "streamSettings": {
                "sockopt": {
                    "tproxy": "tproxy",
                    "mark": 255
                }
            }
        },

gissily avatar Mar 15 '25 09:03 gissily

Some ssh seems to do not work on v5.29.2 with "dokodemo-door" inbound.

Try reverting 7f50592?

dyhkwong avatar Mar 16 '25 07:03 dyhkwong

I have authored a new release that will hopefully fix all the issues mentioned in this issue. Please have a check. https://github.com/v2fly/v2ray-core/releases/tag/v5.29.3

xiaokangwang avatar Mar 23 '25 18:03 xiaokangwang

I have not heard any complaint about crashes. So this patch works?

Thank you very much, after I upgraded to v5.29.2, the problem seems to have been completely resolved; I would like to feedback my test situation: After I just upgraded, I used Chrome browser to play videos all the time and generated traffic through v2ray, which lasted for 7 days without program crash. Now the normal access and use have been nearly a month, and no previous problems have occurred. I think the v5.29.2 release successfully solved the problem.

Steven-X97 avatar Mar 27 '25 08:03 Steven-X97

v5.29.3 has fixed the 'ssh' issue, and other issues are fixed well.

gissily avatar Mar 28 '25 06:03 gissily

v5.29.3 seems fixed on my machine 🎉

BeautyyuYanli avatar Apr 01 '25 06:04 BeautyyuYanli

Now random "signal: kill" occurs to kill the core, without any other messages. Not sure if related to this issue.

BeautyyuYanli avatar Apr 03 '25 03:04 BeautyyuYanli

Now random "signal: kill" occurs to kill the core, without any other messages. Not sure if related to this issue.

please check the kernel log for "oom killer", which might to related to memory leak bugs. please report any finding anyway

xiaokangwang avatar Apr 03 '25 17:04 xiaokangwang

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] avatar Aug 31 '25 02:08 github-actions[bot]

This issue should be fixed. I will close it now. Please feel free to reopen it if the issue is still there.

xiaokangwang avatar Sep 01 '25 16:09 xiaokangwang