NULL pointer dereference when deleting a user #7233

Closed
opened 2025-11-02 07:20:22 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @a1batross on GitHub (Apr 22, 2021).

  • Gitea version (or commit ref): 1.14.1 from GitHub Releases
  • Git version: 2.25.1
  • Operating system: Ubuntu 20.04.2
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x150485f]

goroutine 1 [running]:
code.gitea.io/gitea/models.deleteUser(0x40bf3c0, 0xc0023f3ad0, 0xc00035e280, 0x3, 0xc00193def0)
        /source/models/user.go:1263 +0x255f
code.gitea.io/gitea/models.DeleteUser(0xc00035e280, 0x0, 0x0)
        /source/models/user.go:1287 +0xcf
code.gitea.io/gitea/cmd.runDeleteUser(0xc0003e4580, 0x7ffc3a2287b3, 0xc0003e4160)
        /source/cmd/admin.go:512 +0x1ba
github.com/urfave/cli.HandleAction(0x2654160, 0x38bd758, 0xc0003e4580, 0xc0003e4580, 0x0)
        /source/vendor/github.com/urfave/cli/app.go:524 +0x105
github.com/urfave/cli.Command.Run(0x2a823e0, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2c58177, 0x29, 0x0, ...)
        /source/vendor/github.com/urfave/cli/command.go:173 +0x579
github.com/urfave/cli.(*App).RunAsSubcommand(0xc0023ba380, 0xc0003e42c0, 0x0, 0x0)
        /source/vendor/github.com/urfave/cli/app.go:405 +0x914
github.com/urfave/cli.Command.startApp(0x2a683b6, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2b0e041, 0xc, 0x0, ...)
        /source/vendor/github.com/urfave/cli/command.go:372 +0x7ff
github.com/urfave/cli.Command.Run(0x2a683b6, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2b0e041, 0xc, 0x0, ...)
        /source/vendor/github.com/urfave/cli/command.go:102 +0x9d4
github.com/urfave/cli.(*App).RunAsSubcommand(0xc0023ba1c0, 0xc0003e4160, 0x0, 0x0)
        /source/vendor/github.com/urfave/cli/app.go:405 +0x914
github.com/urfave/cli.Command.startApp(0x2a7141a, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2c92632, 0x42, 0x0, ...)
        /source/vendor/github.com/urfave/cli/command.go:372 +0x7ff
github.com/urfave/cli.Command.Run(0x2a7141a, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2c92632, 0x42, 0x0, ...)
        /source/vendor/github.com/urfave/cli/command.go:102 +0x9d4
github.com/urfave/cli.(*App).Run(0xc0023ba000, 0xc00003c080, 0x8, 0x8, 0x0, 0x0)
        /source/vendor/github.com/urfave/cli/app.go:277 +0x808
main.main()
        /source/main.go:115 +0xa6a
Originally created by @a1batross on GitHub (Apr 22, 2021). - Gitea version (or commit ref): 1.14.1 from GitHub Releases - Git version: 2.25.1 - Operating system: Ubuntu 20.04.2 - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - Log gist: ``` panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x150485f] goroutine 1 [running]: code.gitea.io/gitea/models.deleteUser(0x40bf3c0, 0xc0023f3ad0, 0xc00035e280, 0x3, 0xc00193def0) /source/models/user.go:1263 +0x255f code.gitea.io/gitea/models.DeleteUser(0xc00035e280, 0x0, 0x0) /source/models/user.go:1287 +0xcf code.gitea.io/gitea/cmd.runDeleteUser(0xc0003e4580, 0x7ffc3a2287b3, 0xc0003e4160) /source/cmd/admin.go:512 +0x1ba github.com/urfave/cli.HandleAction(0x2654160, 0x38bd758, 0xc0003e4580, 0xc0003e4580, 0x0) /source/vendor/github.com/urfave/cli/app.go:524 +0x105 github.com/urfave/cli.Command.Run(0x2a823e0, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2c58177, 0x29, 0x0, ...) /source/vendor/github.com/urfave/cli/command.go:173 +0x579 github.com/urfave/cli.(*App).RunAsSubcommand(0xc0023ba380, 0xc0003e42c0, 0x0, 0x0) /source/vendor/github.com/urfave/cli/app.go:405 +0x914 github.com/urfave/cli.Command.startApp(0x2a683b6, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2b0e041, 0xc, 0x0, ...) /source/vendor/github.com/urfave/cli/command.go:372 +0x7ff github.com/urfave/cli.Command.Run(0x2a683b6, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2b0e041, 0xc, 0x0, ...) /source/vendor/github.com/urfave/cli/command.go:102 +0x9d4 github.com/urfave/cli.(*App).RunAsSubcommand(0xc0023ba1c0, 0xc0003e4160, 0x0, 0x0) /source/vendor/github.com/urfave/cli/app.go:405 +0x914 github.com/urfave/cli.Command.startApp(0x2a7141a, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2c92632, 0x42, 0x0, ...) /source/vendor/github.com/urfave/cli/command.go:372 +0x7ff github.com/urfave/cli.Command.Run(0x2a7141a, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2c92632, 0x42, 0x0, ...) /source/vendor/github.com/urfave/cli/command.go:102 +0x9d4 github.com/urfave/cli.(*App).Run(0xc0023ba000, 0xc00003c080, 0x8, 0x8, 0x0, 0x0) /source/vendor/github.com/urfave/cli/app.go:277 +0x808 main.main() /source/main.go:115 +0xa6a ```
GiteaMirror added the type/bug label 2025-11-02 07:20:22 -06:00
Author
Owner

@6543 commented on GitHub (Apr 22, 2021):

this only can happen if storage.Avatars is nil -> witch should not be the case ... @a1batross how does your storage config looks like?

@6543 commented on GitHub (Apr 22, 2021): this only can happen if `storage.Avatars` is nil -> witch should not be the case ... @a1batross how does your storage config looks like?
Author
Owner

@a1batross commented on GitHub (Apr 22, 2021):

@6543 what's the storage config?
I only have enabled gravatar and federated avatars.

@a1batross commented on GitHub (Apr 22, 2021): @6543 what's the storage config? I only have enabled gravatar and federated avatars.
Author
Owner

@a1batross commented on GitHub (Apr 22, 2021):

This doesn't happen with Web admin panel though.

@a1batross commented on GitHub (Apr 22, 2021): This doesn't happen with Web admin panel though.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7233