Skip to content

Crash: invalid log msg: http2: panic serving CLIENT_IP:CLIENT_PORT: runtime error: index out of range [-1] #872

@sbrl

Description

@sbrl

I'm getting a reproducible crash in Fabio:

invalid log msg: 2022/05/14 21:46:56 http2: panic serving 172.16.230.53:54970: runtime error: index out of range [-1]
goroutine 170 [running]:
net/http.(*http2serverConn).runHandler.func1()
        /usr/local/opt/go/libexec/src/net/http/h2_bundle.go:5896 +0x174
panic({0x828870, 0x32aa060})
        /usr/local/opt/go/libexec/src/runtime/panic.go:838 +0x23c
github.com/fabiolb/fabio/route.rndPicker(0x311c8c0)
        /Users/njohnson/jetbrains/fabio/src/github.com/fabiolb/fabio/route/picker.go:20 +0x58
github.com/fabiolb/fabio/route.Table.lookup(0x3000120, {0x33e52d7, 0x17}, {0x32f6000, 0x1f}, {0x0, 0x0}, 0x9063f4, 0x9063f0)
        /Users/njohnson/jetbrains/fabio/src/github.com/fabiolb/fabio/route/table.go:463 +0x194
github.com/fabiolb/fabio/route.Table.Lookup(0x3000120, 0x33fc080, {0x0, 0x0}, 0x9063f4, 0x9063f0, 0x3066090, 0x0)
        /Users/njohnson/jetbrains/fabio/src/github.com/fabiolb/fabio/route/table.go:424 +0x2dc
main.newHTTPProxy.func2(0x33fc080)
        /Users/njohnson/jetbrains/fabio/src/github.com/fabiolb/fabio/main.go:233 +0xc4
github.com/fabiolb/fabio/proxy.(*HTTPProxy).ServeHTTP(0x3336000, {0x9d663c, 0x3096178}, 0x33fc080)
        /Users/njohnson/jetbrains/fabio/src/github.com/fabiolb/fabio/proxy/http_proxy.go:100 +0x1b8
net/http.serverHandler.ServeHTTP({0x30aa2d0}, {0x9d663c, 0x3096178}, 0x33fc080)
        /usr/local/opt/go/libexec/src/net/http/server.go:2916 +0x408
net/http.initALPNRequest.ServeHTTP({{0x9d6be0, 0x32f26c0}, 0x319c400, {0x30aa2d0}}, {0x9d663c, 0x3096178}, 0x33fc080)
        /usr/local/opt/go/libexec/src/net/http/server.go:3523 +0x180
net/http.(*http2serverConn).runHandler(0x306e380, 0x3096178, 0x33fc080, 0x31180a0)
        /usr/local/opt/go/libexec/src/net/http/h2_bundle.go:5903 +0x98
created by net/http.(*http2serverConn).processHeaders
        /usr/local/opt/go/libexec/src/net/http/h2_bundle.go:5633 +0x690
invalid log msg: 2022/05/14 21:46:56 http2: panic serving 172.16.230.53:54970: runtime error: index out of range [-1]
goroutine 171 [running]:
net/http.(*http2serverConn).runHandler.func1()
        /usr/local/opt/go/libexec/src/net/http/h2_bundle.go:5896 +0x174
panic({0x828870, 0x3266010})
        /usr/local/opt/go/libexec/src/runtime/panic.go:838 +0x23c
github.com/fabiolb/fabio/route.rndPicker(0x311c8c0)
        /Users/njohnson/jetbrains/fabio/src/github.com/fabiolb/fabio/route/picker.go:20 +0x58
github.com/fabiolb/fabio/route.Table.lookup(0x3000120, {0x33e52d7, 0x17}, {0x32f6040, 0x1f}, {0x0, 0x0}, 0x9063f4, 0x9063f0)
        /Users/njohnson/jetbrains/fabio/src/github.com/fabiolb/fabio/route/table.go:463 +0x194
github.com/fabiolb/fabio/route.Table.Lookup(0x3000120, 0x33fc180, {0x0, 0x0}, 0x9063f4, 0x9063f0, 0x3066090, 0x0)
        /Users/njohnson/jetbrains/fabio/src/github.com/fabiolb/fabio/route/table.go:424 +0x2dc
main.newHTTPProxy.func2(0x33fc180)
        /Users/njohnson/jetbrains/fabio/src/github.com/fabiolb/fabio/main.go:233 +0xc4
github.com/fabiolb/fabio/proxy.(*HTTPProxy).ServeHTTP(0x3336000, {0x9d663c, 0x3096268}, 0x33fc180)
        /Users/njohnson/jetbrains/fabio/src/github.com/fabiolb/fabio/proxy/http_proxy.go:100 +0x1b8
net/http.serverHandler.ServeHTTP({0x30aa2d0}, {0x9d663c, 0x3096268}, 0x33fc180)
        /usr/local/opt/go/libexec/src/net/http/server.go:2916 +0x408
net/http.initALPNRequest.ServeHTTP({{0x9d6be0, 0x32f26c0}, 0x319c400, {0x30aa2d0}}, {0x9d663c, 0x3096268}, 0x33fc180)
        /usr/local/opt/go/libexec/src/net/http/server.go:3523 +0x180
net/http.(*http2serverConn).runHandler(0x306e380, 0x3096268, 0x33fc180, 0x3118190)
        /usr/local/opt/go/libexec/src/net/http/h2_bundle.go:5903 +0x98
created by net/http.(*http2serverConn).processHeaders
        /usr/local/opt/go/libexec/src/net/http/h2_bundle.go:5633 +0x690
invalid log msg: 2022/05/14 21:46:56 http2: panic serving 172.16.230.53:54970: runtime error: index out of range [-1]
goroutine 172 [running]:
net/http.(*http2serverConn).runHandler.func1()
        /usr/local/opt/go/libexec/src/net/http/h2_bundle.go:5896 +0x174
panic({0x828870, 0x33a00b0})
        /usr/local/opt/go/libexec/src/runtime/panic.go:838 +0x23c
github.com/fabiolb/fabio/route.rndPicker(0x311c8c0)
        /Users/njohnson/jetbrains/fabio/src/github.com/fabiolb/fabio/route/picker.go:20 +0x58
github.com/fabiolb/fabio/route.Table.lookup(0x3000120, {0x33e52d7, 0x17}, {0x32f6060, 0x1a}, {0x0, 0x0}, 0x9063f4, 0x9063f0)
        /Users/njohnson/jetbrains/fabio/src/github.com/fabiolb/fabio/route/table.go:463 +0x194
github.com/fabiolb/fabio/route.Table.Lookup(0x3000120, 0x33fc280, {0x0, 0x0}, 0x9063f4, 0x9063f0, 0x3066090, 0x0)
        /Users/njohnson/jetbrains/fabio/src/github.com/fabiolb/fabio/route/table.go:424 +0x2dc
main.newHTTPProxy.func2(0x33fc280)
        /Users/njohnson/jetbrains/fabio/src/github.com/fabiolb/fabio/main.go:233 +0xc4
github.com/fabiolb/fabio/proxy.(*HTTPProxy).ServeHTTP(0x3336000, {0x9d663c, 0x3096310}, 0x33fc280)
        /Users/njohnson/jetbrains/fabio/src/github.com/fabiolb/fabio/proxy/http_proxy.go:100 +0x1b8
net/http.serverHandler.ServeHTTP({0x30aa2d0}, {0x9d663c, 0x3096310}, 0x33fc280)
        /usr/local/opt/go/libexec/src/net/http/server.go:2916 +0x408
net/http.initALPNRequest.ServeHTTP({{0x9d6be0, 0x32f26c0}, 0x319c400, {0x30aa2d0}}, {0x9d663c, 0x3096310}, 0x33fc280)
        /usr/local/opt/go/libexec/src/net/http/server.go:3523 +0x180
net/http.(*http2serverConn).runHandler(0x306e380, 0x3096310, 0x33fc280, 0x3118200)
        /usr/local/opt/go/libexec/src/net/http/h2_bundle.go:5903 +0x98
created by net/http.(*http2serverConn).processHeaders
        /usr/local/opt/go/libexec/src/net/http/h2_bundle.go:5633 +0x690

Client details

  • Client browser: Mozilla Firefox 101.0b3
  • Client uname -a: Linux DEVICE_NAME 5.13.0-40-generic #45-Ubuntu SMP Tue Mar 29 14:48:14 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Server details

  • Fabio version: 1.6.0 go1.18
  • uname -a: Linux SERVER_NAME 5.10.103-v7l+ #1529 SMP Tue Mar 8 12:24:00 GMT 2022 armv7l GNU/Linux
  • OS: Raspbian GNU/Linux 10 (buster)

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions