Giter Club home page Giter Club logo

Comments (2)

rikusalminen avatar rikusalminen commented on May 22, 2024

I'm not sure what @IceDragon200 did to trigger the panic, but here's a backtrace I got from a similar issue...

To reproduce:

  1. make terminal window really small (like 10x10)
  2. enter command prompt by typing: :

Root cause: division by zero in prompt.rs line 118.

let max_col = area.width / BASE_WIDTH;
let height = ((self.completion.len() as u16 + max_col - 1) / max_col);

In the above area.width = 16 and BASE_WIDTH is hard coded to 30, causing max_col to be zero.

Looks like the command prompt doesn't handle terminal window size correctly, issue #54 was a very similar bug related to BASE_WIDTH and terminal size.

#1 0x0000555556353f54 in std::panicking::rust_panic_with_hook ()
at library/std/src/panicking.rs:610
#2 0x0000555556353a67 in std::panicking::begin_panic_handler::{{closure}} ()
at library/std/src/panicking.rs:495
#3 0x0000555556351a3c in std::sys_common::backtrace::__rust_end_short_backtrace<closure-0,!> () at library/std/src/sys_common/backtrace.rs:141
#4 0x00005555563539f9 in std::panicking::begin_panic_handler ()
at library/std/src/panicking.rs:493
#5 0x00005555556dbdd1 in core::panicking::panic_fmt ()
at library/core/src/panicking.rs:92
#6 0x00005555556dbd1d in core::panicking::panic () at library/core/src/panicking.rs:50
#7 0x0000555555896ed5 in hx::ui::prompt::Prompt::render_prompt (self=0x555557626b50,
area=..., surface=0x7fffffffbec0, cx=0x7fffffff9c88)
at helix-term/src/ui/prompt.rs:118
#8 0x0000555555897706 in hx::ui::prompt::{{impl}}::render (self=0x555557626b50,
area=..., surface=0x7fffffffbec0, cx=0x7fffffff9c88)
at helix-term/src/ui/prompt.rs:273
#9 0x00005555557386de in hx::compositor::Compositor::render (self=0x7fffffffbea0,
cx=0x7fffffff9c88) at helix-term/src/compositor.rs:137
#10 0x00005555557d58ec in hx::application::Application::render (self=0x7fffffffbea0)
at helix-term/src/application.rs:79
#11 0x00005555557d704d in hx::application::Application::handle_terminal_events (
self=0x7fffffffbea0, event=...) at helix-term/src/application.rs:138
#12 0x00005555557d6679 in hx::application::{{impl}}::event_loop::{{closure}} ()
at helix-term/src/application.rs:96
#13 0x000055555571e76b in core::future::from_generator::{{impl}}::poll (
self=..., cx=0x7fffffffbe18)
at /home/rsalminen/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/future/mod.rs:80
#14 0x00005555557d904f in hx::application::{{impl}}::run::{{closure}} ()
at helix-term/src/application.rs:254
#15 0x000055555571e159 in core::future::from_generator::{{impl}}::poll (
self=..., cx=0x7fffffffbe18)
at /home/rsalminen/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/future/mod.rs:80
#16 0x00005555557dbee7 in hx::main::{{closure}} () at helix-term/src/main.rs:169
#17 0x000055555571d7f9 in core::future::from_generator::{{impl}}::poll (
self=..., cx=0x7fffffffbe18)
at /home/rsalminen/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/future/mod.rs:80
#18 0x00005555558b4060 in tokio::park::thread::{{impl}}::block_on::{{closure}}<core::future::from_generator::GenFuture> ()
at /home/rsalminen/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.6.1/src/park/thread.rs:263

from helix.

archseer avatar archseer commented on May 22, 2024

Fixed by #121

from helix.

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.