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

segfault after deleting branch (single occurrence) #3110

Closed
niv opened this issue Nov 8, 2023 · 2 comments
Closed

segfault after deleting branch (single occurrence) #3110

niv opened this issue Nov 8, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@niv
Copy link

niv commented Nov 8, 2023

In repository, deleted a branch. Branch was filtered down by typing and pressing enter, then d to delete.

Branch was deleted successfully, and lazygit crashed immediately after.

Did not happen on creating/deleting other branches, cannot reproduce.

To reproduce:

  • Create dummy branch, focus branch list
  • / dummy enter
  • d, Enter

Version info:

MacOS Sonoma

lazygit: commit=, build date=, build source=homebrew, version=0.40.2, os=darwin, arch=arm64, git version=2.42.1

git: git version 2.42.1

Additional context

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x8 pc=0x100cdc868]

goroutine 227 [running]:
github.com/jesseduffield/lazygit/pkg/gui/presentation.GetBranchListDisplayStrings.func1(0x140004195e0?, 0x0?)
	github.com/jesseduffield/lazygit/pkg/gui/presentation/branches.go:29 +0x38
github.com/samber/lo.Map[...]({0x140004195e0?, 0xd, 0x101091d60}, 0x14000a59ae0?)
	github.com/samber/[email protected]/slice.go:29 +0x68
github.com/jesseduffield/lazygit/pkg/gui/presentation.GetBranchListDisplayStrings({0x140004195e0?, 0xce?, 0x14000bbbb98?}, 0x2c?, {0x0?, 0x100cfc1cc?}, 0x14000047900?, 0x1010f1480?, {0x140001b60b8?, 0xce?, ...})
	github.com/jesseduffield/lazygit/pkg/gui/presentation/branches.go:28 +0x80
github.com/jesseduffield/lazygit/pkg/gui/context.NewBranchesContext.func3(0x1401d257b90?, 0x140006ac000?)
	github.com/jesseduffield/lazygit/pkg/gui/context/branches_context.go:28 +0xf8
github.com/jesseduffield/lazygit/pkg/gui/context.(*ListContextTrait).HandleRender(0x14000047940)
	github.com/jesseduffield/lazygit/pkg/gui/context/list_context_trait.go:90 +0x9c
github.com/jesseduffield/lazygit/pkg/gui.(*Gui).postRefreshUpdate(0x14000462000, {0x1010f5068, 0x140000307c0})
	github.com/jesseduffield/lazygit/pkg/gui/view_helpers.go:139 +0x98
github.com/jesseduffield/lazygit/pkg/gui.(*guiCommon).PostRefreshUpdate(0x14000368630?, {0x1010f5068?, 0x140000307c0?})
	github.com/jesseduffield/lazygit/pkg/gui/gui_common.go:32 +0x28
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers.(*RefreshHelper).refreshBranches(0x14000047cc0)
	github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:438 +0x324
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers.(*RefreshHelper).refreshReflogAndBranches(0x1400006af38?)
	github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:253 +0x28
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers.(*RefreshHelper).Refresh.func2.1.1({0x1400008a4e0?, 0x1400008a480?})
	github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:101 +0x24
github.com/jesseduffield/gocui.(*Gui).onWorkerAux(0x100b508a0?, 0x1400078e648?, {0x1010ec2b0?, 0x140007aabc0?})
	github.com/jesseduffield/[email protected]/gui.go:678 +0x6c
github.com/jesseduffield/gocui.(*Gui).OnWorker.func1()
	github.com/jesseduffield/[email protected]/gui.go:665 +0x34
created by github.com/jesseduffield/gocui.(*Gui).OnWorker
	github.com/jesseduffield/[email protected]/gui.go:664 +0x9c
[1]    63179 exit 2     lazygit
@niv niv added the bug Something isn't working label Nov 8, 2023
@stefanhaller
Copy link
Collaborator

Could it be that you deleted the branch while you were filtering the branches list? If so, that would be a duplicate of #3056 (your stack trace looks very similar to that one), and it's fixed in #3058.

@niv
Copy link
Author

niv commented Nov 8, 2023

Could it be that you deleted the branch while you were filtering the branches list? If so, that would be a duplicate of #3056 (your stack trace looks very similar to that one), and it's fixed in #3058.

Confirmed, thanks for doing the lookup for me. I tried searching for the stacktrace but somehow failed to find the pre-existing issue.

@niv niv closed this as completed Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants