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

Panic when trying to open files in $HOME #81

Closed
cjohansson opened this issue Jun 3, 2021 · 8 comments
Closed

Panic when trying to open files in $HOME #81

cjohansson opened this issue Jun 3, 2021 · 8 comments

Comments

@cjohansson
Copy link

cjohansson commented Jun 3, 2021

Present-working-directory of shell is located at $HOME/Downloads/helix-editor/helix

  1. $ RUST_BACKTRACE=1 hx
  2. :open ../../ (Panic occurs when second slash is typed)

thread 'main' panicked at 'index out of bounds: the len is 10070 but the index is 61356', helix-tui/src/buffer.rs:185:14
stack backtrace:
0: rust_begin_unwind
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/panicking.rs:493:5
1: core::panicking::panic_fmt
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/core/src/panicking.rs:92:14
2: core::panicking::panic_bounds_check
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/core/src/panicking.rs:69:5
3: helix_tui::buffer::Buffer::clear_with
4: <hx::ui::prompt::Prompt as hx::compositor::Component>::render
5: hx::compositor::Compositor::render
6: hx::main::{{closure}}
7: tokio::runtime::enter::Enter::block_on
8: tokio::runtime::Runtime::block_on
9: hx::main
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

Ubuntu 20.04.2 LTS

@archseer
Copy link
Member

archseer commented Jun 7, 2021

I think this should be fixed on master by now. Let me know to reopen if necessary.

@archseer archseer closed this as completed Jun 7, 2021
@cjohansson
Copy link
Author

cjohansson commented Jun 8, 2021

The issue remains, tested on commit b873fb9897bb5b24a60cca3d9fa69285446a857f

@archseer archseer reopened this Jun 8, 2021
@archseer
Copy link
Member

archseer commented Jun 8, 2021

What terminal emulator are you using?

@cjohansson
Copy link
Author

cjohansson commented Jun 8, 2021

$ zsh --version
zsh 5.8 (x86_64-ubuntu-linux-gnu)
$ basename "/"$(ps -f -p $(cat /proc/$(echo $$)/stat | cut -d \  -f 4) | tail -1 | sed 's/^.* //')
gnome-terminal-server
$ echo $TERM
xterm-256color

But I get the exact same issue in bash, see below (or am I doing something wrong here?)

$ bash        
$ cd ~/Downloads/helix-editor/helix/
$ RUST_BACKTRACE=1 hx
thread 'main' panicked at 'index out of bounds: the len is 1920 but the index is 49296', helix-tui/src/buffer.rs:185:14
stack backtrace:
   0: rust_begin_unwind
             at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/core/src/panicking.rs:92:14
   2: core::panicking::panic_bounds_check
             at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/core/src/panicking.rs:69:5
   3: helix_tui::buffer::Buffer::clear_with
   4: helix_term::ui::prompt::Prompt::render_prompt
   5: helix_term::compositor::Compositor::render
   6: helix_term::application::Application::handle_terminal_events
   7: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
   8: tokio::park::thread::CachedParkThread::block_on
   9: tokio::runtime::thread_pool::ThreadPool::block_on
  10: tokio::runtime::Runtime::block_on
  11: hx::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

@archseer
Copy link
Member

archseer commented Jun 8, 2021

Terminal as in alacritty, kitty, GNOME terminal.

I was able to replicate the bug, it seems to happen on a large folder where there's too many completions. Looking at a quick fix now

archseer added a commit that referenced this issue Jun 8, 2021
@archseer
Copy link
Member

archseer commented Jun 8, 2021

Pushed a fix in 8372395

@cjohansson
Copy link
Author

Thanks, I can confirm it is working now

@archseer
Copy link
Member

archseer commented Jun 8, 2021

Thanks for reporting it!

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

No branches or pull requests

2 participants