You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a redis proxy services, deployed in two servers. They receive responses from clients and redirect other redis services.
What did you expect to see?
The two run well.
What did you see instead?
The two services are crash at 18:17 and the stack is :
panic: runtime error: slice bounds out of range [:81] with capacity 72
goroutine 2382138 [running]:
internal/poll.(*FD).Write(0xc025650e80, 0xc0f7054230, 0x51, 0x48, 0x0, 0x0, 0x0)
/usr/local/go/src/internal/poll/fd_unix.go:268 +0x405
net.(*netFD).Write(0xc025650e80, 0xc0f7054230, 0x51, 0x48, 0x3c, 0x0, 0x0)
/usr/local/go/src/net/fd_unix.go:220 +0x4f
net.(*conn).Write(0xc07798ea28, 0xc0f7054230, 0x51, 0x48, 0x0, 0x0, 0x0)
/usr/local/go/src/net/net.go:196 +0x8e
git.abc.com/redisproxy/proxy/doublewriter.(*Worker).start(0xc0006accc0)
/Users/abc/go/src/git.abc.com/redisproxy/proxy/doublewriter/writer.go:169 +0x156
created by git.abc.com/redisproxy/proxy/doublewriter.(*Writer).AddWorker
/Users/abc/go/src/git.abc.com/redisproxy/proxy/doublewriter/writer.go:80 +0x29f
Problem
I searched issues and found some similar isssues: #22522#22102 . According to descriptions of those issues, it looks it is OS issue/driver issue. When go call the write syscall.Write, the syscall returns bigger number than input, which caused the panic.
The slices passed to these functions look bad. Their length is 0x51 but their capacity is only 0x48.
You might want to check where git.abc.com/redisproxy/proxy/doublewriter.(*Worker).start gets its slice from. Particularly, check any uses of unsafe or cgo - you should not be able to construct such a slice with pure Go. Also run with the race detector, as a data race could cause this as well.
Closing, as this does not appear to be a bug in Go (yet). Please reopen if you find more evidence pointing to Go itself.
I don't think this issue is related to #22522 or #22102 at all. They have input slices with valid len/cap.
What version of Go are you using (
go version
)?$ go version
compile environment:
running environment:
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
We have a redis proxy services, deployed in two servers. They receive responses from clients and redirect other redis services.
What did you expect to see?
The two run well.
What did you see instead?
The two services are crash at 18:17 and the stack is :
Problem
I searched issues and found some similar isssues: #22522 #22102 . According to descriptions of those issues, it looks it is OS issue/driver issue. When go call the write syscall.Write, the syscall returns bigger number than input, which caused the panic.
So is it a better solution to check the slice range
at https://github.com/golang/go/blob/master/src/internal/poll/fd_unix.go#L267 and returns an error if overflow?
The text was updated successfully, but these errors were encountered: