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 (workflow: syntax highlighting for rust) #4515

Closed
prataprc opened this issue Oct 29, 2022 · 5 comments · Fixed by #4912
Closed

Editor crash (workflow: syntax highlighting for rust) #4515

prataprc opened this issue Oct 29, 2022 · 5 comments · Fixed by #4912
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug

Comments

@prataprc
Copy link

prataprc commented Oct 29, 2022

Summary

Following is the backtrace:

thread 'main' panicked at 'Position 6934 is out of range for changeset len 6932!', helix-core/src/transaction.rs:397:13
stack backtrace:
   0:        0x104d848e4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hdb141e7893323405
   1:        0x104657184 - core::fmt::write::hed96bcfc6342aee5
   2:        0x104d7ef04 - std::io::Write::write_fmt::h67807909d9a5a6e1
   3:        0x104d89798 - std::panicking::default_hook::{{closure}}::h23ab3d10a9c5bb0f
   4:        0x104d894dc - std::panicking::default_hook::hfa3eb92a01f5118c
   5:        0x104d89d7c - std::panicking::rust_panic_with_hook::h94fcfaabb5f8247c
   6:        0x104d89bd8 - std::panicking::begin_panic_handler::{{closure}}::h5c2b0281f2361f0b
   7:        0x104d87e58 - std::sys_common::backtrace::__rust_end_short_backtrace::h48848f94b4985ec4
   8:        0x104d89978 - _rust_begin_unwind
   9:        0x104e259cc - core::panicking::panic_fmt::hfc743f4016412d36
  10:        0x10473edac - helix_core::transaction::ChangeSet::map_pos::h098a1dc3757da322
  11:        0x104725a68 - <smallvec::SmallVec<A> as core::iter::traits::collect::Extend<<A as smallvec::Array>::Item>>::extend::h7a53705e5795b8be
  12:        0x104720fdc - helix_core::selection::Selection::map::ha847eaf81c3fa260
  13:        0x104b794a4 - helix_view::view::View::apply::h88a06322aa7d5975
  14:        0x104abad1c - helix_term::commands::delete_selection_impl::h02293bf2f29ac32d
  15:        0x10491df20 - helix_term::ui::editor::EditorView::handle_keymap_event::{{closure}}::ha0bf74526d5e4d2c
  16:        0x10491de38 - helix_term::ui::editor::EditorView::handle_keymap_event::h7974db61ea0c2d7b
  17:        0x10491fe94 - <helix_term::ui::editor::EditorView as helix_term::compositor::Component>::handle_event::hc181bf21707d7b07
  18:        0x104915284 - helix_term::compositor::Compositor::handle_event::h9457bad99ab691ce
  19:        0x104aee48c - helix_term::application::Application::handle_terminal_events::h0d4ad66cca316417
  20:        0x104c400b4 - hx::main_impl::{{closure}}::h8f2f7170f476568d
  21:        0x104c300dc - std::thread::local::LocalKey<T>::with::hc533c273645dd684
  22:        0x104c268a8 - tokio::park::thread::CachedParkThread::block_on::hd2d048491914be9b
  23:        0x104bfe4c8 - tokio::runtime::scheduler::multi_thread::MultiThread::block_on::h30feeefd63cf4f37
  24:        0x104c4f7bc - tokio::runtime::Runtime::block_on::hcafa90c78ef7b46d
  25:        0x104c160e4 - hx::main::he67e5eef14377470
  26:        0x104c198d0 - std::sys_common::backtrace::__rust_begin_short_backtrace::he53ad0d8c0bf81be
  27:        0x104c441c4 - std::rt::lang_start::{{closure}}::hc5f08d150e2c52e9
  28:        0x104d794e0 - std::rt::lang_start_internal::hc453db0ee48af82e
  29:        0x104c161e8 - _main

Reproduction Steps

My workflow was, make changes to rust/highlights.scm update theme.toml and execute config-reload. I kept doing this in loop.

Sorry, I don't have specifics.

Helix log

2022-10-29T18:55:15.531 helix_view::editor [ERROR] editor error: No more matches
2022-10-29T18:55:16.025 helix_view::editor [ERROR] editor error: No more matches
2022-10-29T18:55:16.209 helix_view::editor [ERROR] editor error: No more matches
2022-10-29T19:17:15.279 helix_view::editor [ERROR] editor error: No more matches
2022-10-29T19:17:16.744 helix_view::editor [ERROR] editor error: No more matches
2022-10-29T19:17:16.912 helix_view::editor [ERROR] editor error: No more matches
2022-10-29T19:18:06.729 helix_view::editor [ERROR] editor error: No more matches
2022-10-29T19:18:06.880 helix_view::editor [ERROR] editor error: No more matches

Not sure this happed when there was crash.

Platform

Mac M1

Terminal Emulator

iterm2

Helix Version

6752c7d

@prataprc prataprc added the C-bug Category: This is a bug label Oct 29, 2022
@kirawi kirawi added the A-helix-term Area: Helix term improvements label Oct 31, 2022
@ocharles
Copy link
Contributor

I just encountered this error while editing a Haskell file:

thread 'main' panicked at 'Position 2418 is out of range for changeset len 2316!', helix-core/src/transaction.rs:397:13
stack backtrace:
   0:     0x56073d1fe204 - std::backtrace_rs::backtrace::libunwind::trace::hb729d9642bb971eb
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x56073d1fe204 - std::backtrace_rs::backtrace::trace_unsynchronized::h373bb774579df5c7
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x56073d1fe204 - std::sys_common::backtrace::_print_fmt::hfbd4e92d240c89bb
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x56073d1fe204 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8f618991fbf64972
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x56073c9b3dbc - core::fmt::write::hc69b5b640d88cce8
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/core/src/fmt/mod.rs:1196:17
   5:     0x56073d1f7e55 - std::io::Write::write_fmt::h3403cef06a24a303
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/io/mod.rs:1654:15
   6:     0x56073d1ffd9a - std::sys_common::backtrace::_print::h368f27cdedea0e52
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x56073d1ffd9a - std::sys_common::backtrace::print::ha105c9cf5a64cd17
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x56073d1ffd9a - std::panicking::default_hook::{{closure}}::h48ed2c3707d5e20e
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:295:22
   9:     0x56073d1ffa89 - std::panicking::default_hook::h8744fc5cea5e3110
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:314:9
  10:     0x56073d2004c4 - std::panicking::rust_panic_with_hook::hc82286af2030e925
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:702:17
  11:     0x56073d2002c4 - std::panicking::begin_panic_handler::{{closure}}::h1c15057c2f09081f
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:588:13
  12:     0x56073d1fe734 - std::sys_common::backtrace::__rust_end_short_backtrace::h65de906a5330f8da
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/sys_common/backtrace.rs:138:18
  13:     0x56073d20002d - rust_begin_unwind
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:584:5
  14:     0x56073c929c43 - core::panicking::panic_fmt::h741cfbfc95bc6112
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/core/src/panicking.rs:142:14
  15:     0x56073ca459e2 - helix_core::transaction::ChangeSet::map_pos::h3b8d4b862ce79a73
  16:     0x56073caac062 - <smallvec::SmallVec<A> as core::iter::traits::collect::Extend<<A as smallvec::Array>::Item>>::extend::h9353f24943a8adb6
  17:     0x56073ca96c08 - helix_core::selection::Selection::map::h38a117362ec5faad
  18:     0x56073cfceb5e - helix_view::view::View::apply::h63a06e25249251a6
  19:     0x56073cd1fcd8 - <helix_term::ui::editor::EditorView as helix_term::compositor::Component>::handle_event::hd96ac6191783ea5e
  20:     0x56073cdeefb6 - helix_term::compositor::Compositor::handle_event::hfe298d2c4a88f633
  21:     0x56073cf36986 - helix_term::application::Application::handle_terminal_events::hbc4a57e0163ff0b1
  22:     0x56073d09a6e2 - hx::main_impl::{{closure}}::hc336ae293df92c1b
  23:     0x56073d0a8b35 - tokio::runtime::park::CachedParkThread::block_on::had0607e369ee09e5
  24:     0x56073d061ea5 - tokio::runtime::scheduler::multi_thread::MultiThread::block_on::hce436a96ff9679d2
  25:     0x56073d09235e - tokio::runtime::runtime::Runtime::block_on::h9afb1b572f08ee6f
  26:     0x56073d075852 - hx::main::hacf51b0cfc4802ed
  27:     0x56073d084cf3 - std::sys_common::backtrace::__rust_begin_short_backtrace::h7f03302a645f13d9
  28:     0x56073d08504d - std::rt::lang_start::{{closure}}::hda2ce64a7e6378f3
  29:     0x56073d1f2cde - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hf833e7144973d4be
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/core/src/ops/function.rs:280:13
  30:     0x56073d1f2cde - std::panicking::try::do_call::h79761d203bfb6b46
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:492:40
  31:     0x56073d1f2cde - std::panicking::try::h0561cbbe1722251d
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:456:19
  32:     0x56073d1f2cde - std::panic::catch_unwind::hbca347ddd031b141
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panic.rs:137:14
  33:     0x56073d1f2cde - std::rt::lang_start_internal::{{closure}}::h0492050ad281ec32
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/rt.rs:128:48
  34:     0x56073d1f2cde - std::panicking::try::do_call::h3ebce69871996bb3
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:492:40
  35:     0x56073d1f2cde - std::panicking::try::hbed537d20e728475
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:456:19
  36:     0x56073d1f2cde - std::panic::catch_unwind::h4185e2024c6a5d05
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panic.rs:137:14
  37:     0x56073d1f2cde - std::rt::lang_start_internal::h1899cfd715ca6829
                               at /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/rt.rs:128:20
  38:     0x56073d075962 - main
  39:     0x7f2fef8dd237 - __libc_start_call_main
  40:     0x7f2fef8dd2f5 - __libc_start_main_impl
  41:     0x56073c960f11 - _start
                               at /build/glibc-2.34/csu/../sysdeps/x86_64/start.S:116
  42:                0x0 - <unknown>

@the-mikedavis
Copy link
Member

What version are you running? The original issue here should have been fixed by #4733 and #4865

@ocharles
Copy link
Contributor

ocharles commented Nov 25, 2022

@the-mikedavis e6dad960cf77a3a0fae92ee216d31c9dae59b0ec. It looks like I have 4733 but not 4865. I'll pull now! Edit: never mind, the commit I have does have both of those PRs applied.

@the-mikedavis
Copy link
Member

Do you have a way to reproduce the panic?

@ocharles
Copy link
Contributor

I don't unfortunately. I see this panic occasionally - maybe once or twice a week of daily editing. I rarely even know what I' was doing when it crashes as I'm in some sort of flow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants