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

Graph is (can be) buggy when showWholeGraph true in some cases #3973

Open
ADIX7 opened this issue Oct 9, 2024 · 2 comments
Open

Graph is (can be) buggy when showWholeGraph true in some cases #3973

ADIX7 opened this issue Oct 9, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@ADIX7
Copy link

ADIX7 commented Oct 9, 2024

Describe the bug
When using showWholeGraph the graph is the commits panel works as expected, but when opening the commits of a branch (so pressing Enter on a branch name) the graph bugs. It is quite interesting so not so easy to explain. All the "content" (commit hash, author, commit message) is correct but the graph (where the dots are and where the lines go) is not, the graph is actually the one that is shown in the Commits panel. So it looks like as if the branch specific view does get a list of commits with the correct data and displays the commits hash, author, commit message correctly based on that but for drawing the graph it uses (or not filters?) all the commits. Also, while the correct commit line is highlighted, on the graph the wrong dots and lines are the ones that are highlighted. It seems that the one that is highlighted is the one that should be at the commit that is currently selected but because other commits are also shown the "commit line" and the graph "dot" is not at the correct place.

I tried to debug this, check the git commands, but lazygit --debug crashes:

POTENTIAL DEADLOCK: Recursive locking:
current goroutine 2 lock 0xc000356350
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:504 helpers.(*RefreshHelper).refreshBranches ??? <<<<<
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:503 helpers.(*RefreshHelper).refreshBranches ???
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:273 helpers.(*RefreshHelper).refreshReflogAndBranches ???
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:129 helpers.(*RefreshHelper).Refresh.func2.2 ???
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:107 helpers.(*RefreshHelper).Refresh.func2.1.1 ???
github.com/jesseduffield/[email protected]/gui.go:702 gocui.(*Gui).onWorkerAux ???
github.com/jesseduffield/[email protected]/task.go:22 gocui.(*TaskImpl).Done ???

Previous place where the lock was grabbed (same goroutine)
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:322 helpers.(*RefreshHelper).refreshCommitsWithLimit ??? <<<<<
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:321 helpers.(*RefreshHelper).refreshCommitsWithLimit ???
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:277 helpers.(*RefreshHelper).refreshCommitsAndCommitFiles ???
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:107 helpers.(*RefreshHelper).Refresh.func2.1.1 ???
github.com/jesseduffield/[email protected]/gui.go:702 gocui.(*Gui).onWorkerAux ???
github.com/jesseduffield/[email protected]/task.go:22 gocui.(*TaskImpl).Done ???

Other goroutines holding locks:
goroutine 2 lock 0xc000356340
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:442 helpers.(*RefreshHelper).refreshBranches ??? <<<<<
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:441 helpers.(*RefreshHelper).refreshBranches ???
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:273 helpers.(*RefreshHelper).refreshReflogAndBranches ???
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:129 helpers.(*RefreshHelper).Refresh.func2.2 ???
github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers/refresh_helper.go:107 helpers.(*RefreshHelper).Refresh.func2.1.1 ???
github.com/jesseduffield/[email protected]/gui.go:702 gocui.(*Gui).onWorkerAux ???
github.com/jesseduffield/[email protected]/task.go:22 gocui.(*TaskImpl).Done ???

To Reproduce
Tried to create a minimal repository to reproduce, but I could not, so this must be an edge case. Still trying to create a repo where this also happens.

Expected behavior
Correctly show the graph

Screenshots
kép
kép

Version info:
Lazygit version:
commit=, build date=, build source=homebrew, version=0.44.1, os=linux, arch=amd64, git version=2.46.2

Git version:
git version 2.46.2

@ADIX7 ADIX7 added the bug Something isn't working label Oct 9, 2024
@phanirithvij
Copy link
Contributor

lazygit --debug crashes

#4002

stefanhaller added a commit that referenced this issue Feb 10, 2025
- **PR Description**

This PR solves #4002, and
perhaps #3880 (if they
are indeed duplicates), and the error message preventing debugging in
#3973.

The problem is that our version of `go-deadlock` transitively depends on
a version of `goid` that predates their changes to support go `1.23`,
which results in every goid being the number `2` for some reason.
Bumping the version of `go-deadlock` to include the updated transitive
dependency means that the goids are now correct, and `go-deadlock` does
not confused why goroutine 2 is trying to lock so many things.

I know very little about go vendored dependencies, so all I have done is
edit the `go.mod` entry for `go-deadlock` to be v0.3.5, and then run a
`go mod tidy` and `go mod vendor`. If there is a more correct way to
bump a vendored dependency, feel free to close this PR and just do that!
@ChrisMcD1
Copy link
Contributor

The crashing debug has been solved. Can you recreate the problem with debugging on?

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

3 participants