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

fix out of range panic in search handler #221

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

pk910
Copy link
Member

@pk910 pk910 commented Jan 22, 2025

fix a index out of range panic in the search handler when searching for execution block hashes:

[negroni] PANIC: runtime error: index out of range [0] with length 0
goroutine 32817 [running]:
github.com/urfave/negroni.(*Recovery).ServeHTTP.func1()
	/home/runner/go/pkg/mod/github.com/urfave/[email protected]/recovery.go:159 +0xad
panic({0x14261c0?, 0xc00d47d3e0?})
	/opt/hostedtoolcache/go/1.22.10/x64/src/runtime/panic.go:770 +0x132
github.com/ethpandaops/dora/handlers.SearchAhead({0x7f662469dff0, 0xc00c562628}, 0xc00d9427e0)
	/home/runner/work/dora/dora/handlers/search.go:259 +0x26ff
net/http.HandlerFunc.ServeHTTP(0xc00d9426c0?, {0x7f662469dff0?, 0xc00c562628?}, 0x3878?)
	/opt/hostedtoolcache/go/1.22.10/x64/src/net/http/server.go:2171 +0x29
github.com/gorilla/mux.(*Router).ServeHTTP(0xc00b37b200, {0x7f662469dff0, 0xc00c562628}, 0xc00d942480)
	/home/runner/go/pkg/mod/github.com/gorilla/[email protected]/mux.go:212 +0x1e2
github.com/urfave/negroni.(*Negroni).UseHandler.Wrap.func1({0x7f662469dff0, 0xc00c562628}, 0xc00d942480, 0xc00cbda480)
	/home/runner/go/pkg/mod/github.com/urfave/[email protected]/negroni.go:46 +0x45
github.com/urfave/negroni.HandlerFunc.ServeHTTP(0x24c269decfc?, {0x7f662469dff0?, 0xc00c562628?}, 0x8?, 0x8?)
	/home/runner/go/pkg/mod/github.com/urfave/[email protected]/negroni.go:29 +0x2d
github.com/urfave/negroni.middleware.ServeHTTP({{0x2d47320?, 0xc007859008?}, 0xc007859098?}, {0x7f662469dff0, 0xc00c562628}, 0xc00d942480)
	/home/runner/go/pkg/mod/github.com/urfave/[email protected]/negroni.go:38 +0xa8
github.com/urfave/negroni.(*Recovery).ServeHTTP(0x0?, {0x7f662469dff0?, 0xc00c562628?}, 0xc00f4e3b00?, 0x414485?)
	/home/runner/go/pkg/mod/github.com/urfave/[email protected]/recovery.go:193 +0x7b
github.com/urfave/negroni.middleware.ServeHTTP({{0x2d46480?, 0xc000377a90?}, 0xc007859068?}, {0x7f662469dff0, 0xc00c562628}, 0xc00d942480)
	/home/runner/go/pkg/mod/github.com/urfave/[email protected]/negroni.go:38 +0xa8
github.com/urfave/negroni.(*Negroni).ServeHTTP(0xc0076b1380, {0x2d4cd10, 0xc00f6fa540}, 0xc00d942480)
	/home/runner/go/pkg/mod/github.com/urfave/[email protected]/negroni.go:96 +0x105
net/http.serverHandler.ServeHTTP({0xc009429bf0?}, {0x2d4cd10?, 0xc00f6fa540?}, 0x6?)
	/opt/hostedtoolcache/go/1.22.10/x64/src/net/http/server.go:3142 +0x8e
net/http.(*conn).serve(0xc00e2e0a20, {0x2d51c58, 0xc00049e210})
	/opt/hostedtoolcache/go/1.22.10/x64/src/net/http/server.go:2044 +0x5e8
created by net/http.(*Server).Serve in goroutine 14
	/opt/hostedtoolcache/go/1.22.10/x64/src/net/http/server.go:3290 +0x4b4

@pk910 pk910 merged commit ba1c437 into master Jan 22, 2025
1 check passed
@pk910 pk910 deleted the pk910/fix-panic-in-exec-hash-search branch January 22, 2025 13:37
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

Successfully merging this pull request may close these issues.

2 participants