Giter Site home page Giter Site logo

Comments (13)

extrawurst avatar extrawurst commented on May 1, 2024 1

good catch!

fixed:
image

from gitui.

extrawurst avatar extrawurst commented on May 1, 2024 1

hey @guss77 thanks for investigating further, now you run into this bug: #72

please make sure you checkout current master (it was fixed in fdbd87b) and then it should be gone.

from gitui.

MCord avatar MCord commented on May 1, 2024

That was fast! :)

from gitui.

guss77 avatar guss77 commented on May 1, 2024

With version 0.3.0, this still happens to me on a terminal with height of 18 lines.

from gitui.

extrawurst avatar extrawurst commented on May 1, 2024

@guss77 that's weird. I can't reproduce that anymore. can you run with logging enabled and send me the backtrace that should be dumped?

from gitui.

extrawurst avatar extrawurst commented on May 1, 2024

@guss77 you can find details on how to enable logging in the readme: https://github.com/extrawurst/gitui#diagnostics

it would be great if you could share the generated log after gitui crashed to make sure it is not a duplicate of #72 for which I am waiting for the upstream to merge my PR

from gitui.

guss77 avatar guss77 commented on May 1, 2024

With diagnostics, the log for the crash has this:

08:01:09 [TRACE] (1) gitui::app: [src/app.rs:94] event: Key(KeyEvent { code: Char('h'), modifiers: NONE })
08:01:09 [ERROR] panic: PanicInfo { payload: Any, message: Some(index out of bounds: the len is 4860 but the index is 64828), location: Location { file: "/rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd/src/libcore/slice/mod.rs", line: 2848, col: 14 } }
trace:
   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: <unknown>
   9: <unknown>
  10: <unknown>
  11: <unknown>

from gitui.

extrawurst avatar extrawurst commented on May 1, 2024

Ok @guss77 I am still lost on this one. May I ask you a couple of questions to allow me to find this badboy:

  1. when you have a big enough terminal window - does the help window open?
  2. can you resize the terminal window without any crash while the help window is closed?
  3. if 1. was a yes - can you check if it only crashes when reducing width and height individually?
  4. can you imagine building gitui from source to get debug symbols in there?
  5. are you on discord and interested in helping finding this?

from gitui.

guss77 avatar guss77 commented on May 1, 2024
  1. yes.
  2. My testing up until now was always to start gitui in a small window - I'm using a "pull down terminal" application - when on a vertical screen, the %height of the terminal is fine, but when on a horizontal screen the %height of the terminal is too small for the help window and it crashes. When I test resizing the terminal while gitui is running, then if the help window is closed, resizing the terminal does not crash gitui, but if the help window is open - resizing to a size where the help window does not fit on the screen crashes the app immediately (I didn't try resizing all the way down, just smaller than the help window).
  3. Resizing width or height individually both crash the app if I reduce the size 1 row or column smaller than the size of the help window.
  4. yes. sure.
  5. I'm not running discord normally, but I have an account and can go online to help with that.

I'll review the build instructions and see if I can build gitui.

from gitui.

extrawurst avatar extrawurst commented on May 1, 2024

@guss77 thanks for going through with this. Please build from master it will dump diagnostics into the terminal once it crashes, so u don't have to run with logging.

Regarding discord it is the easiest if you come over to crossterm's discord server: https://discord.gg/K4nyTDB - looking forward to figure this out

from gitui.

guss77 avatar guss77 commented on May 1, 2024

Sorry it took me so long - Ubuntu 20.04 carries Rust 1.141 while gitui requires Rust 1.142.

With the current master debug build, I can't crash gitui by resizing the terminal, and the help screen shows fine for my use case (for which I reported the problem originally).

With more testing I concluded that vertical size is not a problem - I can resize the terminal down to 1 line and it still works, while when resizing horizontally, gitui crashes when going down to 14 characters of width - regardless of whether the help screen is on or not.

When crashing due to insufficient terminal width, I get this in stderr:

panic: PanicInfo { payload: Any, message: Some(Trying to access position outside the buffer: x=14, y=0, area=Rect { x: 0, y: 0, width: 14, height: 47 }), location: Location { file: "/home/odeda/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.9.4/src/buffer.rs", line: 245, col: 9 } }
trace:
   0: gitui::set_panic_handlers::{{closure}}
             at src/main.rs:213
   1: std::panicking::rust_panic_with_hook
             at /usr/src/rustc-1.42.0/src/libstd/panicking.rs:476
   2: rust_begin_unwind
             at /usr/src/rustc-1.42.0/src/libstd/panicking.rs:380
   3: std::panicking::begin_panic_fmt
             at /usr/src/rustc-1.42.0/src/libstd/panicking.rs:334
   4: tui::buffer::Buffer::index_of
             at /home/odeda/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.9.4/src/buffer.rs:245
   5: tui::buffer::Buffer::set_stringn
             at /home/odeda/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.9.4/src/buffer.rs:319
   6: tui::buffer::Buffer::set_string
             at /home/odeda/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.9.4/src/buffer.rs:303
   7: <tui::widgets::tabs::Tabs<T> as tui::widgets::Widget>::render
             at /home/odeda/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.9.4/src/widgets/tabs.rs:128
   8: tui::terminal::Frame<B>::render_widget
             at /home/odeda/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.9.4/src/terminal.rs:65
   9: gitui::app::App::draw_tabs
             at src/app.rs:328
  10: gitui::app::App::draw
             at src/app.rs:82
  11: gitui::draw::{{closure}}
             at src/main.rs:135
  12: tui::terminal::Terminal<B>::draw
             at /home/odeda/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.9.4/src/terminal.rs:187
  13: gitui::draw
             at src/main.rs:135
  14: gitui::main
             at src/main.rs:105
  15: std::rt::lang_start::{{closure}}
             at /usr/src/rustc-1.42.0/src/libstd/rt.rs:67
  16: std::rt::lang_start_internal::{{closure}}
             at /usr/src/rustc-1.42.0/src/libstd/rt.rs:52
      std::panicking::try::do_call
             at /usr/src/rustc-1.42.0/src/libstd/panicking.rs:305
  17: __rust_maybe_catch_panic
             at /usr/src/rustc-1.42.0/src/libpanic_unwind/lib.rs:86
  18: std::panicking::try
             at /usr/src/rustc-1.42.0/src/libstd/panicking.rs:281
      std::panic::catch_unwind
             at /usr/src/rustc-1.42.0/src/libstd/panic.rs:394
      std::rt::lang_start_internal
             at /usr/src/rustc-1.42.0/src/libstd/rt.rs:51
  19: std::rt::lang_start
             at /usr/src/rustc-1.42.0/src/libstd/rt.rs:67
  20: main
  21: __libc_start_main
  22: _start

from gitui.

guss77 avatar guss77 commented on May 1, 2024

After the update, I can no longer crash gitui by resizing the terminal :-)

from gitui.

extrawurst avatar extrawurst commented on May 1, 2024

wohoooo 🥳

from gitui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.