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

PANIC: runtime error: invalid memory address or nil pointer dereference #26331

Closed
stuzer05 opened this issue Aug 4, 2023 · 3 comments · Fixed by #26353
Closed

PANIC: runtime error: invalid memory address or nil pointer dereference #26331

stuzer05 opened this issue Aug 4, 2023 · 3 comments · Fixed by #26353
Labels

Comments

@stuzer05
Copy link
Contributor

stuzer05 commented Aug 4, 2023

Description

Open link with invalid pull index, like
https://example.com/test/repo-name/pulls/99999

An error occurred:

PANIC: runtime error: invalid memory address or nil pointer dereference
/usr/local/go/src/runtime/panic.go:884 (0x44a7f2)
/go/src/code.gitea.io/gitea/modules/web/routing/logger_manager.go:116 (0x1cd2264)
/usr/local/go/src/runtime/panic.go:884 (0x44a7f2)
/usr/local/go/src/runtime/panic.go:260 (0x4621fc)
/usr/local/go/src/runtime/signal_unix.go:841 (0x4621cc)
/go/src/code.gitea.io/gitea/routers/web/repo/pull.go:365 (0x26c5e33)
/usr/local/go/src/reflect/value.go:586 (0x4b7dca)
/usr/local/go/src/reflect/value.go:370 (0x4b707b)
/go/src/code.gitea.io/gitea/modules/web/handler.go:166 (0x1cdb765)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/src/code.gitea.io/gitea/modules/web/handler.go:176 (0x1cdb7fb)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/src/code.gitea.io/gitea/modules/web/handler.go:176 (0x1cdb7fb)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/src/code.gitea.io/gitea/modules/web/handler.go:176 (0x1cdb7fb)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/src/code.gitea.io/gitea/modules/web/handler.go:176 (0x1cdb7fb)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/src/code.gitea.io/gitea/modules/web/handler.go:176 (0x1cdb7fb)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/pkg/mod/github.com/go-chi/chi/[email protected]/chain.go:31 (0x1cd2dcb)
/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:444 (0x1cd5cd5)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/src/code.gitea.io/gitea/modules/web/handler.go:176 (0x1cdb7fb)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/src/code.gitea.io/gitea/modules/web/handler.go:176 (0x1cdb7fb)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/src/code.gitea.io/gitea/modules/web/handler.go:176 (0x1cdb7fb)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/pkg/mod/github.com/go-chi/chi/[email protected]/middleware/get_head.go:37 (0x2595ead)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/src/code.gitea.io/gitea/modules/web/handler.go:145 (0x1cdba2b)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/src/code.gitea.io/gitea/modules/web/handler.go:176 (0x1cdb7fb)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/src/code.gitea.io/gitea/modules/context/context.go:204 (0x1dedd8b)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/src/code.gitea.io/gitea/modules/web/handler.go:145 (0x1cdba2b)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/pkg/mod/gitea.com/go-chi/[email protected]/session.go:257 (0x1d4078a)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/src/code.gitea.io/gitea/modules/web/handler.go:145 (0x1cdba2b)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:73 (0x1cd3a54)
/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:316 (0x1cd5463)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:444 (0x1cd5cd5)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:73 (0x1cd3a54)
/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:316 (0x1cd5463)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:444 (0x1cd5cd5)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/src/code.gitea.io/gitea/modules/web/routing/logger_manager.go:122 (0x1cd2093)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/src/code.gitea.io/gitea/modules/web/handler.go:145 (0x1cdba2b)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/pkg/mod/github.com/chi-middleware/[email protected]/middleware.go:37 (0x25095d6)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/src/code.gitea.io/gitea/modules/web/handler.go:145 (0x1cdba2b)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/src/code.gitea.io/gitea/routers/common/middleware.go:45 (0x250c714)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/src/code.gitea.io/gitea/modules/web/handler.go:145 (0x1cdba2b)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/src/code.gitea.io/gitea/routers/common/middleware.go:37 (0x250c22f)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/src/code.gitea.io/gitea/modules/web/handler.go:145 (0x1cdba2b)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/src/code.gitea.io/gitea/routers/common/middleware.go:99 (0x250b7a9)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/src/code.gitea.io/gitea/modules/web/handler.go:145 (0x1cdba2b)
/usr/local/go/src/net/http/server.go:2122 (0x9cd7ce)
/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:90 (0x1cd3a0f)
/go/src/code.gitea.io/gitea/modules/web/route.go:171 (0x1cdcd0d)
/usr/local/go/src/net/http/server.go:2936 (0x9d0dd5)
/usr/local/go/src/net/http/server.go:1995 (0x9cc2f1)
/usr/local/go/src/runtime/asm_amd64.s:1598 (0x482300)

Gitea Version

latest dev

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

https://try.gitea.io/doktormike/Helloyou/pulls/9999

Database

None

@lunny
Copy link
Member

lunny commented Aug 5, 2023

It should just return 404 but not 500

@lunny
Copy link
Member

lunny commented Aug 5, 2023

related with #24231, @sillyguodong

@wxiaoguang
Copy link
Contributor

I think it's a regression of : Support displaying diff stats in PR tab bar (#25387)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants