Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Panic in command prompt: Trying to access position outside the buffer #54

Closed
rikusalminen opened this issue Jun 2, 2021 · 4 comments
Closed

Comments

@rikusalminen
Copy link

To reproduce:

  1. start helix with cargo run
  2. press :q

I am on arch linux, using xterm. This looks like off-by-one error handling terminal screen size.

$ RUST_BACKTRACE=1 cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.83s
     Running `target/debug/hx`
thread 'main' panicked at 'Trying to access position outside the buffer: x=89, y=45, area=Rect { x: 0, y: 0, width: 89, height: 50 }', helix-tui/src/buffer.rs:217:9
stack backtrace:
   0: rust_begin_unwind
             at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/panicking.rs:493:5
   1: std::panicking::begin_panic_fmt
             at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/panicking.rs:435:5
   2: helix_tui::buffer::Buffer::index_of
             at ./helix-tui/src/buffer.rs:217:9
   3: helix_tui::buffer::Buffer::get_mut
             at ./helix-tui/src/buffer.rs:184:17
   4: helix_tui::buffer::Buffer::clear_with
             at ./helix-tui/src/buffer.rs:395:28
   5: hx::ui::prompt::Prompt::render_prompt
             at ./helix-term/src/ui/prompt.rs:166:13
   6: <hx::ui::prompt::Prompt as hx::compositor::Component>::render
             at ./helix-term/src/ui/prompt.rs:267:9
   7: hx::compositor::Compositor::render
             at ./helix-term/src/compositor.rs:129:13
   8: hx::application::Application::render
             at ./helix-term/src/application.rs:79:9
   9: hx::application::Application::handle_terminal_events
             at ./helix-term/src/application.rs:138:13
  10: hx::application::Application::event_loop::{{closure}}
             at ./helix-term/src/application.rs:96:21
  11: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /home/rsalminen/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/future/mod.rs:80:19
  12: hx::application::Application::run::{{closure}}
             at ./helix-term/src/application.rs:254:9
  13: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /home/rsalminen/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/future/mod.rs:80:19
  14: hx::main::{{closure}}
             at ./helix-term/src/main.rs:116:9
  15: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /home/rsalminen/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/future/mod.rs:80:19
  16: tokio::park::thread::CachedParkThread::block_on::{{closure}}
             at /home/rsalminen/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/tokio-1.6.1/src/park/thread.rs:263:54
  17: tokio::coop::with_budget::{{closure}}
             at /home/rsalminen/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/tokio-1.6.1/src/coop.rs:106:9
  18: std::thread::local::LocalKey<T>::try_with
             at /home/rsalminen/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:272:16
  19: std::thread::local::LocalKey<T>::with
             at /home/rsalminen/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:248:9
  20: tokio::coop::with_budget
             at /home/rsalminen/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/tokio-1.6.1/src/coop.rs:99:5
  21: tokio::coop::budget
             at /home/rsalminen/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/tokio-1.6.1/src/coop.rs:76:5
  22: tokio::park::thread::CachedParkThread::block_on
             at /home/rsalminen/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/tokio-1.6.1/src/park/thread.rs:263:31
  23: tokio::runtime::enter::Enter::block_on
             at /home/rsalminen/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/tokio-1.6.1/src/runtime/enter.rs:151:13
  24: tokio::runtime::thread_pool::ThreadPool::block_on
             at /home/rsalminen/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/tokio-1.6.1/src/runtime/thread_pool/mod.rs:71:9
  25: tokio::runtime::Runtime::block_on
             at /home/rsalminen/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/tokio-1.6.1/src/runtime/mod.rs:452:43
  26: hx::main
             at ./helix-term/src/main.rs:115:5
  27: core::ops::function::FnOnce::call_once
             at /home/rsalminen/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

commit f4560cb (HEAD -> master, origin/master, origin/HEAD)
Author: Blaž Hrastnik blaz@mxxn.io
Date: Wed Jun 2 14:57:43 2021 +0900

@pickfire
Copy link
Contributor

pickfire commented Jun 2, 2021

Same thing, it panic when q is pressed or anything. My terminal width height 80x24

@archseer
Copy link
Member

archseer commented Jun 3, 2021

Can you check again on latest master?

@pickfire
Copy link
Contributor

pickfire commented Jun 3, 2021

It's fixed for me.

@archseer archseer closed this as completed Jun 3, 2021
@rikusalminen
Copy link
Author

Yep, it works now. Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants