lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

lazygit quits itself and leaves gibberish

Open patricorgi opened this issue 3 years ago • 11 comments

Describe the bug lazygit quits randomly and leaves gibberish in the terminal. I believe this may not be a lazygit issue (e.g. could relate to conda), but I'm hoping experts can shed some light on it so I can understand what's going on.

To Reproduce Steps to reproduce the behavior:

  1. Installed miniconda in my remote server (I don't have root privilege). Followed: https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html
  2. Using conda install lazygit to install lazygit
  3. Launch lazygit
  4. Do some normal operations inside
  5. lazygit will out of the blue quit and leave gibberish like in the screenshot below
  6. The bash environment also becomes unusable because the display doesn't update when I type; have to restart a new bash

Expected behavior lazygit should stay open until I close it.

Screenshots Screenshot2023-02-07 10 31 51

Version info: Run lazygit --version and paste the result here

$ lazygit --version
unexpected fault address 0xe36d64
fatal error: fault
[signal SIGBUS: bus error code=0x2 addr=0xe36d64 pc=0x455b41]

goroutine 1 [running, locked to thread]:
runtime.throw(0xbd55d0, 0x5)
	/home/conda/feedstock_root/build_artifacts/lazygit_1637586235263/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/go/src/runtime/panic.go:1117 +0x72 fp=0xc000066540 sp=0xc000066510 pc=0x436172
runtime.sigpanic()
	/home/conda/feedstock_root/build_artifacts/lazygit_1637586235263/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/go/src/runtime/signal_unix.go:731 +0x2c8 fp=0xc000066578 sp=0xc000066540 pc=0x44ce48
runtime.step(0xe36d64, 0x12cc74, 0x12cc74, 0xc0000665f0, 0xc0000665e8, 0x1, 0x0, 0x0, 0x0, 0x0)
	/home/conda/feedstock_root/build_artifacts/lazygit_1637586235263/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/go/src/runtime/symtab.go:979 +0x21 fp=0xc000066598 sp=0xc000066578 pc=0x455b41
runtime.funcMaxSPDelta(0xfad848, 0x10a6d00, 0x10a6d00)
	/home/conda/feedstock_root/build_artifacts/lazygit_1637586235263/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/go/src/runtime/symtab.go:922 +0xc6 fp=0xc000066608 sp=0xc000066598 pc=0x4557c6
runtime.init.5()
	/home/conda/feedstock_root/build_artifacts/lazygit_1637586235263/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/go/src/runtime/preempt.go:319 +0x52 fp=0xc000066638 sp=0xc000066608 pc=0x437332
runtime.doInit(0x109df00)
	/home/conda/feedstock_root/build_artifacts/lazygit_1637586235263/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/go/src/runtime/proc.go:6315 +0xec fp=0xc000066788 sp=0xc000066638 pc=0x4465cc
runtime.main()
	/home/conda/feedstock_root/build_artifacts/lazygit_1637586235263/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/go/src/runtime/proc.go:174 +0x130 fp=0xc0000667e0 sp=0xc000066788 pc=0x438890
runtime.goexit()
	/home/conda/feedstock_root/build_artifacts/lazygit_1637586235263/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/go/src/runtime/asm_amd64.s:1371 +0x1 fp=0xc0000667e8 sp=0xc0000667e0 pc=0x46c5e1
$ lazygit --version
commit=, build date=, build source=unknown, version=unversioned, os=linux, arch=amd64

Run git --version and paste the result here

git version 2.39.1

patricorgi avatar Feb 07 '23 09:02 patricorgi

Does lazygit --version work without errors when you remove the ~/.config/lazygit/ files?

mark2185 avatar Feb 07 '23 09:02 mark2185

Does lazygit --version work without errors when you remove the ~/.config/lazygit/ files?

This happened only once when I run lazygit --version the first time. Now it seems like I can't reproduce this error.

patricorgi avatar Feb 07 '23 09:02 patricorgi

Could you try using a different means of installing? E.g. if you have go then go install github.com/jesseduffield/lazygit@latest, or even manually downloading the static binary?

mark2185 avatar Feb 07 '23 09:02 mark2185

$ lazygit --version
commit=, build date=, build source=unknown, version=unversioned, os=linux, arch=amd64

installed binary is older than f67824b349fdbdcd1779e260f80bd26a446a4702.

Ryooooooga avatar Feb 07 '23 10:02 Ryooooooga

Could you try using a different means of installing? E.g. if you have go then go install github.com/jesseduffield/lazygit@latest, or even manually downloading the static binary?

Thanks a lot for the suggestion! I didn't know you can install packages using go! As go already exists on the server, this allows me to completely ditch miniconda! And after trying a few minutes, go-version lazygit doesn't quit like this, but let me try it longer.

patricorgi avatar Feb 07 '23 10:02 patricorgi

Could you try using a different means of installing? E.g. if you have go then go install github.com/jesseduffield/lazygit@latest, or even manually downloading the static binary?

It lasts longer without an issue but still not permanent.

patricorgi avatar Feb 07 '23 11:02 patricorgi

Just to be sure, you're definitely invoking the newly installed lazygit, and not the old one?

mark2185 avatar Feb 07 '23 11:02 mark2185

Yes, the path indicated by which is

$ which lazygit
~/go/bin/lazygit

patricorgi avatar Feb 07 '23 11:02 patricorgi

For those who experience same issue, I found the workaround: define the following function in your .bashrc

lg() {
    lazygit
    while ! [[ $? -eq 0 ]]; do
        reset
        lazygit
    done
}           

This essentially aliases lazygit to lg, automatically cleans up the gibberish from the crash and restarts lazygit. lazygit will "stay open" until you manually quit it.

patricorgi avatar Feb 17 '23 13:02 patricorgi

Well, uhh, thanks for the workaround, but I'm curious as to why it happens in the first place.

How often does it happen? Does it happen only on this machine?

mark2185 avatar Feb 17 '23 13:02 mark2185

Well, uhh, thanks for the workaround, but I'm curious as to why it happens in the first place.

How often does it happen? Does it happen only on this machine?

Every 5-10 minutes roughly. It allows me to do some git operation quickly but not any longer.

Yes, it only happens to this machine, so I still believe this has nothing to do with lazygit. I also use lazygit in my MacBook locally and it works beautifully. Perhaps the server side sets up some limitations on the memory/CPU allocation for each process? This is beyond my knowledge. In any case, I'm pretty happy with this workaround, but any suggestion for troubleshooting will still be appreciated.

patricorgi avatar Feb 17 '23 13:02 patricorgi