jesseduffield / jesseduffield/lazygit
POTENTIAL DEADLOCK in a lazygit code
- Dominant language
- Go
- Stars
- 82.4k
- Forks
- 3k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 19
Description
**Describe the bug**
POTENTIAL DEADLOCK in a code
**To Reproduce**
run lazygit 10^6 times
**Version info:**
lazygit --version
commit=5e388e21c8ca6aa883dbcbe45c47f6fdd5116815, build date=2023-08-07T14:05:48Z, build source=binaryRelease, version=0.40.2, os=darwin, arch=amd64, git version=2.42.0
git --version
git version 2.42.0
**Additional context**
No context.
**Note:** please try updating to the latest version or [manually building](https://github.com/jesseduffield/lazygit/#manual) the latest `master` to see if the issue still occurs.
```
$ lazygit -debug
POTENTIAL DEADLOCK:
Previous place where the lock was grabbed
goroutine 51 lock 0xc0000ac110
panic: runtime error: index out of range [2236] with length 0
panic: close of closed channel
goroutine 1 [running]:
github.com/jesseduffield/gocui.(*Gui).Close(0x136291f?)
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:264 +0x25
panic({0x18501e0, 0xc00012cd20})
/opt/hostedtoolcache/go/1.20.7/x64/src/runtime/panic.go:884 +0x213
github.com/stefanhaller/tcell/v2.(*CellBuffer).SetContent(0x0?, 0x0?, 0x0?, 0x20?, {0x0?, 0x0?, 0x0?}, {0x100000002, 0x0, 0x0, ...})
/home/runner/work/lazygit/lazygit/vendor/github.com/stefanhaller/tcell/v2/cell.go:51 +0x245
github.com/stefanhaller/tcell/v2.(*tScreen).SetContent(0xc0000fc2c0, 0xc000aab350?, 0x13517ee?, 0x7?, {0x0?, 0x0?, 0x0?}, {0x100000002, 0x0, 0x0, ...})
/home/runner/work/lazygit/lazygit/vendor/github.com/stefanhaller/tcell/v2/tscreen.go:613 +0x10e
github.com/jesseduffield/gocui.tcellSetCell(0x0?, 0xc0000fc56c?, 0xaab420?, 0x1367222?, 0x100000007?, 0x0?)
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/tcell_driver.go:103 +0xe2
github.com/jesseduffield/gocui.(*View).clearRunes(0xc0006383c0)
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/view.go:1124 +0xa5
github.com/jesseduffield/gocui.(*View).draw(0xc0006383c0)
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/view.go:937 +0xc8
github.com/jesseduffield/gocui.(*Gui).draw(0xc000092340, 0xc0006383c0)
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:1192 +0x17a
github.com/jesseduffield/gocui.(*Gui).flush(0xc000092340)
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:1144 +0x116
github.com/jesseduffield/gocui.(*Gui).processEvent(0xc000092340)
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:766 +0x2a5
github.com/jesseduffield/gocui.(*Gui).MainLoop(0xc000092340)
/home/runner/work/lazygit/lazygit/vendor/github.com/jesseduffield/gocui/gui.go:739 +0xa5
github.com/jesseduffield/lazygit/pkg/gui.(*Gui).Run(0xc0000fc000, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}})
/home/runner/work/lazygit/lazygit/pkg/gui/gui.go:669 +0x5e5
github.com/jesseduffield/lazygit/pkg/gui.(*Gui).RunAndHandleError.func1()
/home/runner/work/lazygit/lazygit/pkg/gui/gui.go:675 +0x4c
github.com/jesseduffield/lazygit/pkg/utils.SafeWithError(0x0?)
/home/runner/work/lazygit/lazygit/pkg/utils/utils.go:108 +0x67
github.com/jesseduffield/lazygit/pkg/gui.(*Gui).RunAndHandleError(0xc0000fc000, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}})
/home/runner/work/lazygit/lazygit/pkg/gui/gui.go:674 +0xd4
github.com/jesseduffield/lazygit/pkg/app.(*App).Run(...)
/home/runner/work/lazygit/lazygit/pkg/app/app.go:263
github.com/jesseduffield/lazygit/pkg/app.Run({0x19eff50?, 0xc0002dc640?}, 0xc0002ec3f0, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}})
/home/runner/work/lazygit/lazygit/pkg/app/app.go:48 +0xe9
github.com/jesseduffield/lazygit/pkg/app.Start(0xc0001dff30, {0x0, 0x0})
/home/runner/work/lazygit/lazygit/pkg/app/entry_point.go:150 +0xd46
main.main()
/home/runner/work/lazygit/lazygit/main.go:23 +0x9e
```
Contributor guide
Assessment
This issue has not been assessed yet.