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

Editor crash #4484

Closed
prataprc opened this issue Oct 27, 2022 · 4 comments · Fixed by #4570
Closed

Editor crash #4484

prataprc opened this issue Oct 27, 2022 · 4 comments · Fixed by #4570
Labels
C-bug Category: This is a bug

Comments

@prataprc
Copy link

prataprc commented Oct 27, 2022

Summary

While executing motion commands (j, k) in view-mode lead to the following crash.

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Line index out of bounds: line index 100, Rope/RopeSlice line count 97', /Users/prataprc/.cargo/registry/src/gitpro.ttaallkk.top-1ecc6299db9ec823/ropey-1.5.0/src/slice.rs:424:41
stack backtrace:
   0:        0x104e848e4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hdb141e7893323405
   1:        0x104757184 - core::fmt::write::hed96bcfc6342aee5
   2:        0x104e7ef04 - std::io::Write::write_fmt::h67807909d9a5a6e1
   3:        0x104e89798 - std::panicking::default_hook::{{closure}}::h23ab3d10a9c5bb0f
   4:        0x104e894dc - std::panicking::default_hook::hfa3eb92a01f5118c
   5:        0x104e89d7c - std::panicking::rust_panic_with_hook::h94fcfaabb5f8247c
   6:        0x104e89bd8 - std::panicking::begin_panic_handler::{{closure}}::h5c2b0281f2361f0b
   7:        0x104e87e58 - std::sys_common::backtrace::__rust_end_short_backtrace::h48848f94b4985ec4
   8:        0x104e89978 - _rust_begin_unwind
   9:        0x104f259cc - core::panicking::panic_fmt::hfc743f4016412d36
  10:        0x104f25a70 - core::result::unwrap_failed::h964512213a00d9f4
  11:        0x104a173c8 - helix_term::ui::editor::EditorView::doc_syntax_highlights::hcbe1f40d23906329
  12:        0x104a15e84 - helix_term::ui::editor::EditorView::render_view::ha5ad0032b19eb186
  13:        0x104a21340 - <helix_term::ui::editor::EditorView as helix_term::compositor::Component>::render::h41cb7e2815a69398
  14:        0x104a154cc - helix_term::compositor::Compositor::render::h732404bbabb4fd52
  15:        0x104bee50c - helix_term::application::Application::handle_terminal_events::h0d4ad66cca316417
  16:        0x104d400b4 - hx::main_impl::{{closure}}::h8f2f7170f476568d
  17:        0x104d300dc - std::thread::local::LocalKey<T>::with::hc533c273645dd684
  18:        0x104d268a8 - tokio::park::thread::CachedParkThread::block_on::hd2d048491914be9b
  19:        0x104cfe4c8 - tokio::runtime::scheduler::multi_thread::MultiThread::block_on::h30feeefd63cf4f37
  20:        0x104d4f7bc - tokio::runtime::Runtime::block_on::hcafa90c78ef7b46d
  21:        0x104d160e4 - hx::main::he67e5eef14377470
  22:        0x104d198d0 - std::sys_common::backtrace::__rust_begin_short_backtrace::he53ad0d8c0bf81be
  23:        0x104d441c4 - std::rt::lang_start::{{closure}}::hc5f08d150e2c52e9
  24:        0x104e794e0 - std::rt::lang_start_internal::hc453db0ee48af82e
  25:        0x104d161e8 - _main

Reproduction Steps

mostly motion command in view-mode.

Another point, not sure whether it matters, is that I was running tail -f ~/.cache/helix/helix.log on a different terminal window.

Helix log

~/.cache/helix/helix.log
2022-10-27T17:11:21.066 helix_view::editor [ERROR] editor error: Invalid regex: ?
2022-10-27T17:11:21.538 helix_view::editor [ERROR] editor error: Invalid regex: ?
2022-10-27T17:11:21.737 helix_view::editor [ERROR] editor error: Invalid regex: ?
2022-10-27T17:22:36.871 helix_view::editor [ERROR] editor error: failed to load theme `rpc-hx-theme` - Failed to deserialize theme
2022-10-27T17:26:27.361 helix_view::editor [ERROR] editor error: failed to load theme `rpc-hx-theme` - Failed to deserialize theme
2022-10-27T17:28:07.334 helix_view::editor [ERROR] editor error: failed to load theme `rpc-hx-theme` - Failed to deserialize theme
2022-10-27T17:28:29.032 helix_view::editor [ERROR] editor error: failed to load theme `rpc-hx-theme` - Failed to deserialize theme
2022-10-27T17:29:00.605 helix_term::application [WARN] failed to load theme `rpc-hx-theme` - Failed to deserialize theme
2022-10-27T17:29:04.109 helix_view::editor [ERROR] editor error: Register [@] empty
2022-10-27T17:30:01.741 helix_view::editor [ERROR] editor error: failed to load theme `rpc-hx-theme` - Failed to deserialize theme

Platform

mac m1

Terminal Emulator

iterm2

Helix Version

65edf9c

@prataprc prataprc added the C-bug Category: This is a bug label Oct 27, 2022
@CptPotato
Copy link
Contributor

Which version of helix are you using?

The stack trace looks a lot like #2305.

There's also #3978 and #2850 that panic at the same location but they might have different causes.

@the-mikedavis
Copy link
Member

Can you give concrete reproduction steps (exact key-presses on an example file)? I tried paging around with Z and j, k but couldn't reproduce

@prataprc
Copy link
Author

prataprc commented Oct 28, 2022

Which version of helix are you using?

Tip of the master.

Can you give concrete reproduction steps ?

I exited by terminal (iterm2) and tmux. And after that I cannot reproduce.

Should I close this as can't reproduce ?

@CptPotato
Copy link
Contributor

I'd keep it open since it still seems like a bug, even if some misbehavior of the terminal caused it.

I think neither the terminal, nor a multiplexer should be able to cause helix to panic.

@archseer archseer linked a pull request Nov 3, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants