-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Solution for panic: runtime error: slice bounds out of range [2:0] #1501
Comments
Why line 253 nBytes will read more date than the length of b.Len()... |
@cross-hello I don't know! its weird. but by my code it will be fixed permanently. |
Why you don't change the code to |
@cross-hello |
We doubt the bytes count of b may be corrupt inside concurrency, where memory lock is lacking in.
Jan 9, 2023 02:09:00 Zero Dwide ***@***.***>:
… @cross-hello[https://github.com/cross-hello]
The main problem is sometimes for unknown reasons *b.start* became higher than *b.end*
does your code ensures *b.start* won't be higher than *b.end*?
—
Reply to this email directly, view it on GitHub[#1501 (comment)], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AKGBAYDW7TTCPTBUF5RY27LWRL7DXANCNFSM6AAAAAATUSLWQU].
You are receiving this because you were mentioned.[Tracking image][https://github.com/notifications/beacon/AKGBAYFY5XZQJT4LAZUY6L3WRL7DXA5CNFSM6AAAAAATUSLWQWWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTSR6M4I4.gif]
|
之前有一个修复是 c880b91 ,但它是处理外部传入的 to b.start 和 b.end 是私有字段,小概率是 @cross-hello 说的情况,大概率是 buffer.go 自己的代码造成了 b.start > b.end,请排查 |
|
剛剛在Apline Linux Docker 复现这个情况: panic: runtime error: slice bounds out of range [:538] with capacity 0 goroutine 1293 [running]: |
Does this the cause for *ray series memories leaking?
Jan 9, 2023 13:30:29 MP ***@***.***>:
… 剛剛在Apline Linux Docker 复现这个情况:
panic: runtime error: slice bounds out of range [:538] with capacity 0
goroutine 1293 [running]:
github.com/xtls/xray-core/common/buf.(*Buffer).BytesRange(...)
/github/workspace/tmp/common/buf/buffer.go:141
github.com/xtls/xray-core/proxy/vless/encoding.XtlsUnpadding({0x8f3a2e0, 0xb8117a0}, {0xb2e7ac0, 0x1, 0x1}, {0xa7e1520, 0x10, 0x10}, 0xa9a0dac, 0xa9a0da8, ...)
/github/workspace/tmp/proxy/vless/encoding/encoding.go:579 +0xd08
github.com/xtls/xray-core/proxy/vless/encoding.XtlsRead.func1({0x8f3a2e0, 0xb8117a0}, {0x8f3e2a0, 0xb2e7a30}, {0x0, 0x0}, {0x8f39c4c, 0xb2e7ae0}, 0xa9a0eb8, 0xaba7702, ...)
/github/workspace/tmp/proxy/vless/encoding/encoding.go:298 +0x45a
github.com/xtls/xray-core/proxy/vless/encoding.XtlsRead({0x8f309f0, 0xb6c0b28}, {0x8f31940, 0xb2e7b20}, {0x8f30d38, 0xbb90480}, {0x8f3e2a0, 0xb2e7a30}, {0x8f39c4c, 0xb2e7ae0}, ...)
/github/workspace/tmp/proxy/vless/encoding/encoding.go:336 +0x11f
github.com/xtls/xray-core/proxy/vless/inbound.(*Handler).Process.func4()
/github/workspace/tmp/proxy/vless/inbound/inbound.go:566 +0x42d
github.com/xtls/xray-core/common/task.OnSuccess.func1()
/github/workspace/tmp/common/task/task.go:12 +0x23
github.com/xtls/xray-core/common/task.Run.func1(0xb6545f0)
/github/workspace/tmp/common/task/task.go:28 +0x2b
created by github.com/xtls/xray-core/common/task.Run
/github/workspace/tmp/common/task/task.go:27 +0xbe
—
Reply to this email directly, view it on GitHub[#1501 (comment)], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AKGBAYAYNF4KZ2WGJYFZOPDWROO7LANCNFSM6AAAAAATUSLWQU].
You are receiving this because you were mentioned.[Tracking image][https://github.com/notifications/beacon/AKGBAYD5LO36OECSH5AGEJLWROO7LA5CNFSM6AAAAAATUSLWQWWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTSR627US.gif]
|
我详细查看了代码,并提交了 7b8ff01 以确保任何时候 0 <= b.start <= b.end,请测试该 commit,若仍有问题,请开新的 issue @asiaqa 你发的是另一个问题,请开新的 issue 并 @yuhan6665 |
(buffer.go 的其它代码理论上本就可以确保 0 <= b.start <= b.end,无需为此修改) |
Unpadding 这个我研究一下 |
謝謝兩位大佬! |
Thanks everybody for contribution. @RPRX when we have it in next release? |
Considering that I am using the latest version, I still get the following 2 errors Solution for panic: runtime error: slice bounds out of range [2:0] |
@zerodwide @moradianali Use the latest commit, not the latest version. 看来下次需要连发两个版本,bugfix 专版 v1.7.3,和 Reality 专版 v1.8.0 |
Thank You . This problem is very annoying. When will the new version be released? |
Greatings!
I have lot of users on simple VLESS+TCP+XTLS config, which most of time is okay, but every 5-15 minutes i have a panic and crash Xray for about 30 seconds.
I don't know how this error occurs, but it is exists on all versions of Xray (until latest 1.7) have this weird bug:
also lots of other people has this issue, for example: #1422
Solution:
file: github.com/xtls/xray-core/common/buf/buffer.go:253
I added this line of code above line 253
Dear @RPRX
Q1: I ask you to check the code and include it in next version
Q2: is "return 0, io.EOF" is best return for such that illogical inputs?
final code:
full panic log:
The text was updated successfully, but these errors were encountered: