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

exits on Branches #1470

Closed
alensiljak opened this issue Dec 12, 2022 · 10 comments
Closed

exits on Branches #1470

alensiljak opened this issue Dec 12, 2022 · 10 comments
Labels
bug Something isn't working
Milestone

Comments

@alensiljak
Copy link
Contributor

Whenever I type B to open the branches view, the program exits. This is happening in Termux on Android. The application works fine otherwise.
I tried with -l but am not sure where the log location is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the Status view
  2. Press B
  3. The app exits

Expected behavior
See the Branches view or whatever is supposed to be displayed on B.

Context (please complete the following information):

  • OS/Distro + Version: Termux, LineageOS 19
  • GitUI Version 0.22.1

Additional context
Installed via Termux packages.

@alensiljak alensiljak added the bug Something isn't working label Dec 12, 2022
@extrawurst
Copy link
Collaborator

please see https://github.com/extrawurst/gitui#diagnostics - the log would be crucial to figure this one out. even better if you have a public repo I can reproduce this in

@alensiljak
Copy link
Contributor Author

Great, thanks! The log is here. This happens with all the repos I've tried today (4-5) in Termux.

@extrawurst
Copy link
Collaborator

Ok do you have a public repository I can reproduce this with?

@alensiljak
Copy link
Contributor Author

Sure. It happens with any repository I've tried so far.
For example https://github.com/alensiljak/cashier-sveltekit

@chipbuster
Copy link

chipbuster commented Dec 18, 2022

I got hit by this issue too. It took me a while to narrow down when it happened and when it didn't because sometimes things seemed to arbitrarily work, and sometimes it would just crash on going to branches.

Long story short, I believe this bug is triggered when the terminal size is too small to display the list of branches. You can trigger this bug by opening a gitui in a big terminal, displaying the list of branches, and then resizing the terminal window with click-drag. Once the vertical size of the terminal window is too small to display all the branches, gitui will crash.

Here is a log from one such run of gitui:

GitUI log from shrinking window with branches active until crash
04:55:36 [TRACE] (6) mio::poll: [/home/chipbuster/.cargo/registry/src/github.jparrowsec.cn-1ecc6299db9ec823/mio-0.8.5/src/poll.rs:532] registering event source with poller: token=Token(0), interests=READABLE
04:55:36 [TRACE] (6) mio::poll: [/home/chipbuster/.cargo/registry/src/github.jparrowsec.cn-1ecc6299db9ec823/mio-0.8.5/src/poll.rs:532] registering event source with poller: token=Token(1), interests=READABLE
04:55:36 [TRACE] (1) gitui::watcher: [src/watcher.rs:21] poll watcher: false recommended: Inotify
04:55:36 [TRACE] (1) gitui::app: [src/app.rs:119] open repo at: RefCell { value: Path(".") }
04:55:36 [TRACE] (7) mio::poll: [/home/chipbuster/.cargo/registry/src/github.jparrowsec.cn-1ecc6299db9ec823/mio-0.8.5/src/poll.rs:532] registering event source with poller: token=Token(0), interests=READABLE
04:55:36 [TRACE] (1) asyncgit::status: [asyncgit/src/status.rs:102] request: [hash: 2652087392596048398] (type: WorkingDir)
04:55:36 [TRACE] (1) asyncgit::status: [asyncgit/src/status.rs:102] request: [hash: 18100230348623768735] (type: Stage)
04:55:36 [TRACE] (1) gitui: [src/main.rs:200] app start: 8 ms
04:55:36 [TRACE] (1) gitui::app: [src/app.rs:477] update
04:55:36 [TRACE] (5) asyncgit::status: [asyncgit/src/status.rs:160] status fetched: 18100230348623768735 (type: Stage)
04:55:36 [TRACE] (1) asyncgit::status: [asyncgit/src/status.rs:96] request blocked, still pending
04:55:36 [TRACE] (1) asyncgit::status: [asyncgit/src/status.rs:102] request: [hash: 4495434111187727569] (type: Stage)
04:55:36 [TRACE] (3) asyncgit::status: [asyncgit/src/status.rs:160] status fetched: 2652087392596048398 (type: WorkingDir)
04:55:36 [TRACE] (4) asyncgit::status: [asyncgit/src/status.rs:160] status fetched: 4495434111187727569 (type: Stage)
04:55:36 [TRACE] (1) gitui::app: [src/app.rs:496] update_async: Git(Status)
04:55:36 [TRACE] (1) gitui::app: [src/app.rs:496] update_async: Git(Status)
04:55:36 [TRACE] (1) gitui::app: [src/app.rs:496] update_async: Git(Status)
04:55:36 [TRACE] (1) gitui::app: [src/app.rs:496] update_async: Git(Branches)
04:55:37 [TRACE] (1) gitui::app: [src/app.rs:382] event: Input(Key(KeyEvent { code: Char('b'), modifiers: NONE, kind: Press, state: NONE }))
04:55:38 [TRACE] (1) gitui::app: [src/app.rs:382] event: Input(Resize(91, 29))
04:55:38 [TRACE] (1) gitui::app: [src/app.rs:382] event: Input(Resize(90, 28))
04:55:38 [TRACE] (1) gitui::app: [src/app.rs:382] event: Input(Resize(90, 27))
04:55:38 [TRACE] (1) gitui::app: [src/app.rs:382] event: Input(Resize(89, 27))
04:55:38 [TRACE] (1) gitui::app: [src/app.rs:382] event: Input(Resize(88, 26))
04:55:38 [TRACE] (1) gitui::app: [src/app.rs:382] event: Input(Resize(87, 26))
04:55:38 [TRACE] (1) gitui::app: [src/app.rs:382] event: Input(Resize(87, 25))
04:55:38 [TRACE] (1) gitui::app: [src/app.rs:382] event: Input(Resize(86, 25))
04:55:38 [TRACE] (1) gitui::app: [src/app.rs:382] event: Input(Resize(85, 24))
04:55:38 [TRACE] (1) gitui::app: [src/app.rs:382] event: Input(Resize(84, 24))
04:55:38 [TRACE] (1) gitui::app: [src/app.rs:382] event: Input(Resize(83, 24))
04:55:38 [TRACE] (1) gitui::app: [src/app.rs:382] event: Input(Resize(82, 23))
04:55:38 [TRACE] (1) gitui::app: [src/app.rs:382] event: Input(Resize(79, 22))
04:55:39 [DEBUG] (8) gitui::watcher: notify events: 1
04:55:39 [DEBUG] (8) gitui::watcher: notify [0]: DebouncedEvent { path: "/home/chipbuster/Codes/oss/starship/.git/gitui", kind: Any }
04:55:39 [TRACE] (1) gitui::app: [src/app.rs:477] update
04:55:39 [TRACE] (1) asyncgit::status: [asyncgit/src/status.rs:102] request: [hash: 9006606135878124375] (type: WorkingDir)
04:55:39 [TRACE] (1) asyncgit::status: [asyncgit/src/status.rs:102] request: [hash: 17572278111568878712] (type: Stage)
04:55:39 [TRACE] (3) asyncgit::status: [asyncgit/src/status.rs:160] status fetched: 17572278111568878712 (type: Stage)
04:55:39 [TRACE] (1) gitui::app: [src/app.rs:496] update_async: Git(Status)
04:55:39 [TRACE] (1) gitui::app: [src/app.rs:382] event: Input(Resize(79, 21))
04:55:39 [TRACE] (2) asyncgit::status: [asyncgit/src/status.rs:160] status fetched: 9006606135878124375 (type: WorkingDir)
04:55:39 [TRACE] (1) gitui::app: [src/app.rs:496] update_async: Git(Status)
04:55:39 [TRACE] (1) gitui::app: [src/app.rs:382] event: Input(Resize(78, 21))
04:55:39 [TRACE] (1) gitui::app: [src/app.rs:382] event: Input(Resize(77, 20))
04:55:39 [TRACE] (1) gitui::app: [src/app.rs:382] event: Input(Resize(76, 19))
04:55:39 [ERROR] panic: PanicInfo { payload: Any { .. }, message: Some(assertion failed: min <= max), location: Location { file: "/rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/cmp.rs", line: 860, col: 9 }, can_unwind: true }
trace:
   0: gitui::set_panic_handlers::{{closure}}
             at /home/chipbuster/tmp/gitui/src/main.rs:360:19
   1: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/alloc/src/boxed.rs:2001:9
      std::panicking::rust_panic_with_hook
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:692:13
   2: std::panicking::begin_panic_handler::{{closure}}
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:577:13
   3: std::sys_common::backtrace::__rust_end_short_backtrace
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:137:18
   4: rust_begin_unwind
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:575:5
   5: core::panicking::panic_fmt
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/panicking.rs:65:14
   6: core::panicking::panic
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/panicking.rs:115:5
   7: core::cmp::Ord::clamp
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/cmp.rs:860:9
   8: gitui::ui::rect_inside
             at /home/chipbuster/tmp/gitui/src/ui/mod.rs:91:19
   9: <gitui::components::branchlist::BranchListComponent as gitui::components::DrawableComponent>::draw
             at /home/chipbuster/tmp/gitui/src/components/branchlist.rs:73:5
  10: gitui::app::App::draw_popups
             at /home/chipbuster/tmp/gitui/src/components/mod.rs:130:16
  11: gitui::app::App::draw
             at /home/chipbuster/tmp/gitui/src/app.rs:375:3
  12: gitui::draw::{{closure}}
             at /home/chipbuster/tmp/gitui/src/main.rs:292:19
  13: tui::terminal::Terminal<B>::draw
             at /home/chipbuster/.cargo/registry/src/github.jparrowsec.cn-1ecc6299db9ec823/tui-0.19.0/src/terminal.rs:263:9
  14: gitui::draw
             at /home/chipbuster/tmp/gitui/src/main.rs:291:2
  15: gitui::run_app
             at /home/chipbuster/tmp/gitui/src/main.rs:248:4
  16: gitui::main
             at /home/chipbuster/tmp/gitui/src/main.rs:147:20
  17: core::ops::function::FnOnce::call_once
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/ops/function.rs:251:5
  18: std::sys_common::backtrace::__rust_begin_short_backtrace
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:121:18
  19: std::rt::lang_start::{{closure}}
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/rt.rs:166:18
  20: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/ops/function.rs:286:13
      std::panicking::try::do_call
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:483:40
      std::panicking::try
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:447:19
      std::panic::catch_unwind
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panic.rs:137:14
      std::rt::lang_start_internal::{{closure}}
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/rt.rs:148:48
      std::panicking::try::do_call
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:483:40
      std::panicking::try
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:447:19
      std::panic::catch_unwind
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panic.rs:137:14
      std::rt::lang_start_internal
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/rt.rs:148:20
  21: std::rt::lang_start
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/rt.rs:165:17
  22: main
  23: <unknown>
  24: __libc_start_main
  25: _start
             at /build/glibc/src/glibc/csu/../sysdeps/x86_64/start.S:115

Let me know if there's anything else I can do to help narrow down the root cause!

@alensiljak
Copy link
Contributor Author

Seems likely! This is happening on a phone, which was not explicitly stated but I thought it was obvious from the LineageOS (Android) and Termux references.

@extrawurst
Copy link
Collaborator

good catch! fixes on master

@alensiljak
Copy link
Contributor Author

Just to double-check:

min.height > max.height {
		max.width

Is the width used here on purpose?
I have not run the master version yet. Just checking.

@extrawurst
Copy link
Collaborator

@alensiljak good catch. fixed in 669ea61

@alensiljak
Copy link
Contributor Author

I tried the master version on desktop, resizing the window to an allowed minimum, as suggested by chipbuster. Seems ok. The minimum size seems even smaller than the one on the phone so the implemented solution should fix it.

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