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

crash when using "Custom command" for commit addition #3923

Open
band-a-prend opened this issue Sep 18, 2024 · 2 comments
Open

crash when using "Custom command" for commit addition #3923

band-a-prend opened this issue Sep 18, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@band-a-prend
Copy link
Contributor

Describe the bug
Instead of using shortcut c to commit changes I use Shift+; shortcut for "Custom command" to add additional options to git commit command and to get external text editor (e.g. nano). Since lazygit-0.44.0 release and in lazygit-0.44.1 after I save commit message changes the lazygit Stop and "crashes".

Maybe it's related to use of pgp-key to sign the commits too.

The lazygit-0.43.1 isn't affected by this issue

To Reproduce
Steps to reproduce the behavior:

  1. Change directory in terminal to any git repo
  2. Make any changes in files under this repo
  3. Launch the lazygit and accept changes in appropriate window
  4. Use Shift+; shortcut to open "Custom command" prompt and enter git commit (or e.g. git commit -s -S)
  5. In opened text editor enter message, save end exit text editor
  6. Notice that lazygit crashes with [1]+ Stopped lazygit message in terminal after Press enter to return to lazygit message.

Expected behavior
Show Press enter to return to lazygit message after exit from text editor without stop running lazygit.

Screenshots

Version info:
lazygit --version: commit=, build date=, build source=unknown, version=0.44.1, os=linux, arch=amd64, git version=2.44.2
git --version: git version 2.44.2

Additional context
gdb output:

$ gdb lazygit
GNU gdb (Gentoo 14.2 vanilla) 14.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from lazygit...
warning: File "/usr/lib/go/src/runtime/runtime-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
        add-auto-load-safe-path /usr/lib/go/src/runtime/runtime-gdb.py
line to your configuration file "/home/user/.config/gdb/gdbinit".
To completely disable this security protection add
        set auto-load safe-path /
line to your configuration file "/home/user/.config/gdb/gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
        info "(gdb)Auto-loading safe path"
(gdb) run
Starting program: /usr/bin/lazygit 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffb13486c0 (LWP 17279)]
[New Thread 0x7fffb0b476c0 (LWP 17280)]
[New Thread 0x7fffabfff6c0 (LWP 17281)]
[New Thread 0x7fffab7fe6c0 (LWP 17282)]
[New Thread 0x7fffaaffd6c0 (LWP 17283)]
[Detaching after vfork from child process 17284]
[Detaching after vfork from child process 17285]
[New Thread 0x7fffaa7fc6c0 (LWP 17287)]

+ /bin/bash -i -c git commit -s -S

[Detaching after vfork from child process 17343]
[dev 1a99e35ca] lazygit
 2 files changed, 33 insertions(+)
 create mode 100644 dev-vcs/lazygit/lazygit-0.44.1.ebuild

Press enter to return to lazygit
Thread 8 "lazygit" received signal SIGTTIN, Stopped (tty input).
[Switching to Thread 0x7fffa9ffb6c0 (LWP 17288)]
runtime/internal/syscall.Syscall6 () at /usr/lib/go/src/runtime/internal/syscall/asm_linux_amd64.s:36
36              CMPQ    AX, $0xfffffffffffff001
(gdb) bt
#0  runtime/internal/syscall.Syscall6 () at /usr/lib/go/src/runtime/internal/syscall/asm_linux_amd64.s:36
#1  0x000055555556350d in syscall.RawSyscall6 (num=18446744073709551104, a1=0, a2=93824992294190, a3=0, a4=824636563728, a5=0, a6=0, r1=<optimized out>, r2=<optimized out>, errno=<optimized out>)
    at /usr/lib/go/src/runtime/internal/syscall/syscall_linux.go:38
#2  0x000055555563a746 in syscall.Syscall (trap=0, a1=0, a2=824636563728, a3=1, r1=<optimized out>, r2=<optimized out>, err=<optimized out>) at /usr/lib/go/src/syscall/syscall_linux.go:82
#3  0x00005555556387d8 in syscall.read (fd=<optimized out>, p=..., n=<optimized out>, err=...) at /usr/lib/go/src/syscall/zsyscall_linux_amd64.go:736
#4  0x0000555555656fee in syscall.Read (fd=0, n=<optimized out>, err=..., p=...) at /usr/lib/go/src/syscall/syscall_unix.go:181
#5  internal/poll.ignoringEINTRIO (fd=0, fn=<optimized out>, p=...) at /usr/lib/go/src/internal/poll/fd_unix.go:736
#6  internal/poll.(*FD).Read (fd=0xc000110000, p=..., ~r0=<optimized out>, ~r0=<optimized out>, ~r1=..., ~r1=...) at /usr/lib/go/src/internal/poll/fd_unix.go:160
#7  0x00005555556623b2 in os.(*File).read (f=0xc000072020, b=..., n=<optimized out>, err=...) at /usr/lib/go/src/os/file_posix.go:29
#8  os.(*File).Read (f=0xc000072020, b=..., n=<optimized out>, err=...) at /usr/lib/go/src/os/file.go:118
#9  0x00005555555e24f0 in io.ReadAtLeast (r=..., buf=..., min=1, n=<optimized out>, err=...) at /usr/lib/go/src/io/io.go:335
#10 0x0000555555676bfa in io.ReadFull (r=..., buf=..., n=<optimized out>, err=...) at /usr/lib/go/src/io/io.go:354
#11 fmt.(*readRune).readByte (r=0xc0002b60f0, b=<optimized out>, err=...) at /usr/lib/go/src/fmt/scan.go:321
#12 0x0000555555676cf1 in fmt.(*readRune).ReadRune (r=0xc0002b60f0, rr=<optimized out>, size=<optimized out>, err=...) at /usr/lib/go/src/fmt/scan.go:337
#13 0x00005555556767d3 in fmt.(*ss).ReadRune (s=0xc0001103c0, r=<optimized out>, size=<optimized out>, err=...) at /usr/lib/go/src/fmt/scan.go:189
#14 0x00005555556768b7 in fmt.(*ss).getRune (s=0xfffffffffffffe00, r=<optimized out>) at /usr/lib/go/src/fmt/scan.go:211
#15 0x000055555567733c in fmt.(*ss).SkipSpace (s=0xfffffffffffffe00) at /usr/lib/go/src/fmt/scan.go:422
#16 0x00005555556793ff in fmt.(*ss).convertString (s=0xc0001103c0, verb=118, str=...) at /usr/lib/go/src/fmt/scan.go:828
#17 0x0000555555679f96 in fmt.(*ss).scanOne (s=0xc0001103c0, verb=118, arg=...) at /usr/lib/go/src/fmt/scan.go:1012
#18 0x000055555567aea5 in fmt.(*ss).doScan (s=0xfffffffffffffe00, a=..., numProcessed=<optimized out>, numProcessed=<optimized out>, err=...) at /usr/lib/go/src/fmt/scan.go:1073
#19 0x00005555556764e5 in fmt.Fscanln (r=..., a=..., n=<optimized out>, err=...) at /usr/lib/go/src/fmt/scan.go:132
#20 0x0000555555cd9da5 in fmt.Scanln (a=..., n=<optimized out>, err=...) at /usr/lib/go/src/fmt/scan.go:70
#21 github.com/jesseduffield/lazygit/pkg/gui.(*Gui).runSubprocess (gui=0xc0000c6608, cmdObj=..., ~r0=...) at /var/tmp/portage/dev-vcs/lazygit-0.44.1/work/lazygit-0.44.1/pkg/gui/gui.go:973
#22 0x0000555555cd971e in github.com/jesseduffield/lazygit/pkg/gui.(*Gui).runSubprocessWithSuspense (gui=0xc0000c6608, subprocess=..., ~r0=<optimized out>, ~r0=<optimized out>, ~r1=..., ~r1=...)
    at /var/tmp/portage/dev-vcs/lazygit-0.44.1/work/lazygit-0.44.1/pkg/gui/gui.go:939
#23 0x0000555555cd9565 in github.com/jesseduffield/lazygit/pkg/gui.(*Gui).runSubprocessWithSuspenseAndRefresh (gui=0xfffffffffffffe00, subprocess=..., ~r0=...)
    at /var/tmp/portage/dev-vcs/lazygit-0.44.1/work/lazygit-0.44.1/pkg/gui/gui.go:915
#24 0x0000555555cdaa45 in github.com/jesseduffield/lazygit/pkg/gui.(*guiCommon).RunSubprocessAndRefresh (self=<optimized out>, cmdObj=..., ~r0=...)
    at /var/tmp/portage/dev-vcs/lazygit-0.44.1/work/lazygit-0.44.1/pkg/gui/gui_common.go:37
#25 0x0000555555c92a90 in github.com/jesseduffield/lazygit/pkg/gui/controllers.(*ShellCommandAction).Call.func1 (command=..., ~r0=...)
    at /var/tmp/portage/dev-vcs/lazygit-0.44.1/work/lazygit-0.44.1/pkg/gui/controllers/shell_command_action.go:33
#26 0x0000555555c0436d in github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers.(*ConfirmationHelper).setKeyBindings.(*ConfirmationHelper).wrappedPromptConfirmationFunction.func5 (~r0=...)
    at /var/tmp/portage/dev-vcs/lazygit-0.44.1/work/lazygit-0.44.1/pkg/gui/controllers/helpers/confirmation_helper.go:45
#27 0x0000555555c0431a in github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers.(*ConfirmationHelper).setKeyBindings.(*ConfirmationHelper).wrappedPromptConfirmationFunction.(*ConfirmationHelper).wrappedConfirmationFunction.func8 (~r0=...) at /var/tmp/portage/dev-vcs/lazygit-0.44.1/work/lazygit-0.44.1/pkg/gui/controllers/helpers/confirmation_helper.go:34
#28 0x0000555555ca283b in github.com/jesseduffield/lazygit/pkg/gui/controllers.(*SuggestionsController).GetKeybindings.func1 (~r0=...)
    at /var/tmp/portage/dev-vcs/lazygit-0.44.1/work/lazygit-0.44.1/pkg/gui/controllers/suggestions_controller.go:35
#29 0x0000555555ce0ee4 in github.com/jesseduffield/lazygit/pkg/gui.(*Gui).callKeybindingHandler (gui=0xc0000c6608, binding=<optimized out>, ~r0=...)
    at /var/tmp/portage/dev-vcs/lazygit-0.44.1/work/lazygit-0.44.1/pkg/gui/keybindings.go:465
#30 0x0000555555ce0a9b in github.com/jesseduffield/lazygit/pkg/gui.(*Gui).SetKeybinding.func1 (~r0=...) at /var/tmp/portage/dev-vcs/lazygit-0.44.1/work/lazygit-0.44.1/pkg/gui/keybindings.go:412
#31 0x0000555555ce09b3 in github.com/jesseduffield/lazygit/pkg/gui.(*Gui).SetKeybinding.(*Gui).wrappedHandler.func3 (g=<optimized out>, v=0x0, ~r0=...)
    at /var/tmp/portage/dev-vcs/lazygit-0.44.1/work/lazygit-0.44.1/pkg/gui/keybindings.go:406
#32 0x000055555590c94a in github.com/jesseduffield/gocui.(*Gui).execKeybinding (g=<optimized out>, v=<optimized out>, kb=<optimized out>, ~r0=...)
    at /var/tmp/portage/dev-vcs/lazygit-0.44.1/work/lazygit-0.44.1/vendor/github.com/jesseduffield/gocui/gui.go:1529
#33 0x000055555590c825 in github.com/jesseduffield/gocui.(*Gui).execKeybindings (g=0xc0000a2e00, v=0xc0001d6c00, ev=0xc000cef5a0, ~r0=...)
    at /var/tmp/portage/dev-vcs/lazygit-0.44.1/work/lazygit-0.44.1/vendor/github.com/jesseduffield/gocui/gui.go:1497
#34 0x000055555590bc7e in github.com/jesseduffield/gocui.(*Gui).onKey (g=0xfffffffffffffe00, ev=<optimized out>, ~r0=...)
    at /var/tmp/portage/dev-vcs/lazygit-0.44.1/work/lazygit-0.44.1/vendor/github.com/jesseduffield/gocui/gui.go:1308
#35 0x0000555555909fd9 in github.com/jesseduffield/gocui.(*Gui).handleEvent (g=<optimized out>, ev=<optimized out>, ~r0=...)
    at /var/tmp/portage/dev-vcs/lazygit-0.44.1/work/lazygit-0.44.1/vendor/github.com/jesseduffield/gocui/gui.go:842
#36 0x0000555555909b4f in github.com/jesseduffield/gocui.(*Gui).processEvent (g=0xc0000a2e00, ~r0=..., ~r0=...)
    at /var/tmp/portage/dev-vcs/lazygit-0.44.1/work/lazygit-0.44.1/vendor/github.com/jesseduffield/gocui/gui.go:796
#37 0x0000555555909797 in github.com/jesseduffield/gocui.(*Gui).MainLoop (g=0xc0000a2e00, ~r0=...) at /var/tmp/portage/dev-vcs/lazygit-0.44.1/work/lazygit-0.44.1/vendor/github.com/jesseduffield/gocui/gui.go:775
#38 0x0000555555cd8add in github.com/jesseduffield/lazygit/pkg/gui.(*Gui).Run (gui=0xc0000c6608, startArgs=..., ~r0=..., ~r0=...) at /var/tmp/portage/dev-vcs/lazygit-0.44.1/work/lazygit-0.44.1/pkg/gui/gui.go:846

@band-a-prend band-a-prend added the bug Something isn't working label Sep 18, 2024
@stefanhaller
Copy link
Collaborator

This is not a crash; lazygit is being sent to the background by your shell. You should be able to activate it again by typing fg.

This is a duplicate of #3903, there's some more information there. We know that this was caused by #3793, but I don't understand yet why. Of course, reverting #3793 would fix it, but I'm reluctant to do that because it's a useful feature.

If anybody can shed more light on this, that would be great (either here or over in #3903).

jorgemxm added a commit to jorgemxm/lazygit that referenced this issue Sep 19, 2024
@band-a-prend
Copy link
Contributor Author

Is it possible to make interactive shell feature conditional via additional launch command line option or vise versa?

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