24.03: byte_slice(): Byte range out of bounds
Summary
Just starting to use Helix and love it :clap:
Today i had two crashes, hard to pinpoint what was happening or reproduce. both time did an undo and then go into insert mode.
thread 'main' panicked at /home/abuild/rpmbuild/BUILD/helix-24.03/vendor/ropey/src/slice.rs:703:23:
byte_slice(): Byte range out of bounds: byte range 0..34, Rope/RopeSlice byte length 12
stack backtrace:
0: rust_begin_unwind
1: core::panicking::panic_fmt
2: ropey::slice::RopeSlice::byte_slice
3: helix_core::indent::treesitter_indent_for_pos
4: helix_core::indent::indent_for_newline
5: helix_term::commands::insert::insert_newline
6: helix_term::ui::editor::EditorView::handle_keymap_event::{{closure}}
7: helix_term::ui::editor::EditorView::handle_keymap_event
8: helix_term::ui::editor::EditorView::insert_mode
9: <helix_term::ui::editor::EditorView as helix_term::compositor::Component>::handle_event
10: helix_term::compositor::Compositor::handle_event
11: hx::main_impl::{{closure}}
12: tokio::runtime::park::CachedParkThread::block_on
13: tokio::runtime::context::runtime::enter_runtime
14: tokio::runtime::runtime::Runtime::block_on
15: hx::main
Reproduction Steps
No response
Helix log
~/.cache/helix/helix.log
2024-04-17T09:30:24.669 helix_lsp::transport [ERROR] bash-language-server err <- "(node:13578) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.\n"
2024-04-17T09:30:24.670 helix_lsp::transport [ERROR] bash-language-server err <- "(Use `node21 --trace-deprecation ...` to show where the warning was created)\n"
2024-04-17T09:33:04.152 helix_term::application [WARN] Ignoring a client/registerCapability request because dynamic capability registration is not enabled. Please report this upstream to the language server
2024-04-17T09:38:30.335 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"initialize\"\n"
2024-04-17T09:38:30.335 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"textDocument/foldingRange\"\n"
2024-04-17T09:38:30.335 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"textDocument/documentSymbol\"\n"
2024-04-17T09:38:30.335 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"textDocument/formatting\"\n"
2024-04-17T09:38:30.335 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"textDocument/completion\"\n"
2024-04-17T09:38:30.335 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"textDocument/hover\"\n"
2024-04-17T09:38:30.335 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"textDocument/documentLink\"\n"
2024-04-17T09:38:30.335 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"textDocument/semanticTokens/full\"\n"
2024-04-17T09:38:30.335 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"textDocument/prepareRename\"\n"
2024-04-17T09:38:30.335 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"textDocument/rename\"\n"
2024-04-17T09:38:30.335 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered notification handler method=\"initialized\"\n"
2024-04-17T09:38:30.335 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered notification handler method=\"textDocument/didOpen\"\n"
2024-04-17T09:38:30.335 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered notification handler method=\"textDocument/didSave\"\n"
2024-04-17T09:38:30.335 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered notification handler method=\"textDocument/didChange\"\n"
2024-04-17T09:38:30.335 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered notification handler method=\"workspace/didChangeConfiguration\"\n"
2024-04-17T09:38:30.335 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered notification handler method=\"textDocument/didClose\"\n"
2024-04-17T09:38:30.335 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"taplo/convertToJson\"\n"
2024-04-17T09:38:30.335 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"taplo/convertToToml\"\n"
2024-04-17T09:38:30.335 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered notification handler method=\"workspace/didChangeWorkspaceFolders\"\n"
2024-04-17T09:38:30.335 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"taplo/associatedSchema\"\n"
2024-04-17T09:38:30.335 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"taplo/listSchemas\"\n"
2024-04-17T09:38:30.335 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered notification handler method=\"taplo/associateSchema\"\n"
2024-04-17T09:38:30.343 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: LSP server listening transport=\"stdio\"\n"
2024-04-17T09:38:45.603 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: received shutdown request id=Number(1) method=shutdown\n"
2024-04-17T09:47:06.591 helix_lsp::transport [ERROR] bash-language-server err: <- StreamClosed
2024-04-17T09:47:06.591 helix_lsp::transport [ERROR] err: <- Other(failed to send a message to server
Caused by:
channel closed)
2024-04-17T09:48:20.600 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"initialize\"\n"
2024-04-17T09:48:20.600 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"textDocument/foldingRange\"\n"
2024-04-17T09:48:20.600 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"textDocument/documentSymbol\"\n"
2024-04-17T09:48:20.600 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"textDocument/formatting\"\n"
2024-04-17T09:48:20.600 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"textDocument/completion\"\n"
2024-04-17T09:48:20.600 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"textDocument/hover\"\n"
2024-04-17T09:48:20.600 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"textDocument/semanticTokens/full\"\n"
2024-04-17T09:48:20.600 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"textDocument/documentLink\"\n"
2024-04-17T09:48:20.600 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"textDocument/prepareRename\"\n"
2024-04-17T09:48:20.600 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"textDocument/rename\"\n"
2024-04-17T09:48:20.600 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered notification handler method=\"initialized\"\n"
2024-04-17T09:48:20.601 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered notification handler method=\"textDocument/didOpen\"\n"
2024-04-17T09:48:20.601 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered notification handler method=\"textDocument/didChange\"\n"
2024-04-17T09:48:20.601 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered notification handler method=\"textDocument/didSave\"\n"
2024-04-17T09:48:20.601 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered notification handler method=\"textDocument/didClose\"\n"
2024-04-17T09:48:20.601 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered notification handler method=\"workspace/didChangeConfiguration\"\n"
2024-04-17T09:48:20.601 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered notification handler method=\"workspace/didChangeWorkspaceFolders\"\n"
2024-04-17T09:48:20.601 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"taplo/convertToJson\"\n"
2024-04-17T09:48:20.601 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"taplo/convertToToml\"\n"
2024-04-17T09:48:20.601 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"taplo/listSchemas\"\n"
2024-04-17T09:48:20.601 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered request handler method=\"taplo/associatedSchema\"\n"
2024-04-17T09:48:20.601 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: registered notification handler method=\"taplo/associateSchema\"\n"
2024-04-17T09:48:20.610 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: LSP server listening transport=\"stdio\"\n"
2024-04-17T09:48:28.530 helix_lsp::transport [ERROR] taplo err <- " INFO taplo: received shutdown request id=Number(3) method=shutdown\n"
2024-04-17T10:46:08.081 helix_lsp::transport [ERROR] bash-language-server err <- "(node:26769) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.\n"
2024-04-17T10:46:08.081 helix_lsp::transport [ERROR] bash-language-server err <- "(Use `node21 --trace-deprecation ...` to show where the warning was created)\n"
2024-04-17T10:48:50.684 helix_term::application [WARN] Ignoring a client/registerCapability request because dynamic capability registration is not enabled. Please report this upstream to the language server
2024-04-17T11:16:04.548 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(17)), original request likely timed out
2024-04-17T11:20:30.392 helix_term::application [WARN] Ignoring a client/registerCapability request because dynamic capability registration is not enabled. Please report this upstream to the language server
2024-04-17T11:33:17.557 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(45)), original request likely timed out
2024-04-17T11:38:01.806 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(67)), original request likely timed out
2024-04-17T11:38:01.969 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(68)), original request likely timed out
2024-04-17T11:38:02.130 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(69)), original request likely timed out
2024-04-17T11:38:02.292 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(70)), original request likely timed out
2024-04-17T11:38:02.454 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(71)), original request likely timed out
2024-04-17T11:56:28.920 helix_term::application [WARN] Ignoring a client/registerCapability request because dynamic capability registration is not enabled. Please report this upstream to the language server
2024-04-17T12:42:34.749 helix_lsp::transport [ERROR] err: <- Other(failed to send a message to server
Caused by:
channel closed)
2024-04-17T12:42:34.749 helix_lsp::transport [ERROR] typescript-language-server err: <- StreamClosed
2024-04-17T12:42:34.751 helix_lsp::transport [ERROR] err: <- Other(failed to send a message to server
Caused by:
channel closed)
2024-04-17T12:42:34.751 helix_lsp::transport [ERROR] yaml-language-server err: <- StreamClosed
2024-04-17T12:42:34.752 helix_lsp::transport [ERROR] err: <- Other(failed to send a message to server
Caused by:
channel closed)
2024-04-17T12:42:34.752 helix_lsp::transport [ERROR] docker-langserver err: <- StreamClosed
2024-04-17T12:45:10.872 helix_term::application [WARN] Ignoring a client/registerCapability request because dynamic capability registration is not enabled. Please report this upstream to the language server
2024-04-17T12:47:29.729 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(3)), original request likely timed out
2024-04-17T13:38:13.436 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(16)), original request likely timed out
2024-04-17T14:43:08.046 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(33)), original request likely timed out
2024-04-17T15:00:42.182 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(38)), original request likely timed out
2024-04-17T15:16:29.924 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(79)), original request likely timed out
2024-04-17T15:16:34.736 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(81)), original request likely timed out
2024-04-17T15:16:42.876 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(86)), original request likely timed out
2024-04-17T15:16:43.030 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(87)), original request likely timed out
2024-04-17T15:16:51.447 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(90)), original request likely timed out
2024-04-17T15:18:13.674 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(94)), original request likely timed out
2024-04-17T15:18:47.266 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(100)), original request likely timed out
2024-04-17T15:19:11.607 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(107)), original request likely timed out
2024-04-17T15:48:48.663 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(130)), original request likely timed out
2024-04-17T15:48:48.698 helix_lsp::transport [ERROR] pylsp err <- "2024-04-17 15:48:48,654 CEST - WARNING - pylsp.workspace - There was an error while trying to initialize progress reporting.Likely progress reporting was used in a synchronous LSP handler, which is not supported by progress reporting yet. To prevent waiting for the timeout you can set `skip_token_initialization=True`. Not every editor will show progress then, but many will.\n"
2024-04-17T15:48:48.698 helix_lsp::transport [ERROR] pylsp err <- "Traceback (most recent call last):\n"
2024-04-17T15:48:48.698 helix_lsp::transport [ERROR] pylsp err <- " File \"/home/maikel/.local/share/pipx/venvs/python-lsp-server/lib64/python3.11/site-packages/pylsp/workspace.py\", line 252, in _progress_begin\n"
2024-04-17T15:48:48.698 helix_lsp::transport [ERROR] pylsp err <- " ).result(timeout=1.0)\n"
2024-04-17T15:48:48.698 helix_lsp::transport [ERROR] pylsp err <- " ^^^^^^^^^^^^^^^^^^^\n"
2024-04-17T15:48:48.698 helix_lsp::transport [ERROR] pylsp err <- " File \"/usr/lib64/python3.11/concurrent/futures/_base.py\", line 458, in result\n"
2024-04-17T15:48:48.698 helix_lsp::transport [ERROR] pylsp err <- " raise TimeoutError()\n"
2024-04-17T15:48:48.698 helix_lsp::transport [ERROR] pylsp err <- "TimeoutError\n"
2024-04-17T15:48:49.066 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(131)), original request likely timed out
2024-04-17T15:48:49.151 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(132)), original request likely timed out
2024-04-17T15:48:49.219 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(133)), original request likely timed out
2024-04-17T15:48:49.283 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(134)), original request likely timed out
2024-04-17T16:29:22.555 helix_lsp::util [WARN] LSP position Position { line: 2381, character: 0 } out of range assuming EOF
2024-04-17T16:29:22.555 helix_lsp::util [WARN] LSP position Position { line: 2381, character: 100 } out of range assuming EOF
2024-04-17T16:29:25.969 helix_lsp::util [WARN] LSP position Position { line: 2381, character: 0 } out of range assuming EOF
2024-04-17T16:29:25.969 helix_lsp::util [WARN] LSP position Position { line: 2381, character: 100 } out of range assuming EOF
2024-04-17T16:29:27.206 helix_lsp::util [WARN] LSP position Position { line: 2381, character: 0 } out of range assuming EOF
2024-04-17T16:29:27.206 helix_lsp::util [WARN] LSP position Position { line: 2381, character: 100 } out of range assuming EOF
2024-04-17T16:29:27.774 helix_lsp::util [WARN] LSP position Position { line: 2381, character: 0 } out of range assuming EOF
2024-04-17T16:29:27.774 helix_lsp::util [WARN] LSP position Position { line: 2381, character: 100 } out of range assuming EOF
2024-04-17T16:31:15.256 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(182)), original request likely timed out
2024-04-17T16:32:26.473 helix_lsp::transport [ERROR] yaml-language-server err: <- StreamClosed
2024-04-17T16:32:26.474 helix_lsp::transport [ERROR] err: <- Other(failed to send a message to server
Caused by:
channel closed
Stack backtrace:
0: helix_lsp::transport::Transport::process_server_message::{{closure}}
1: helix_lsp::transport::Transport::recv::{{closure}}
2: tokio::runtime::task::core::Core<T,S>::poll
3: tokio::runtime::task::harness::Harness<T,S>::poll
4: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
5: tokio::runtime::scheduler::multi_thread::worker::Context::run
6: tokio::runtime::context::runtime::enter_runtime
7: tokio::runtime::scheduler::multi_thread::worker::run
8: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
9: tokio::runtime::task::core::Core<T,S>::poll
10: tokio::runtime::task::harness::Harness<T,S>::poll
11: tokio::runtime::blocking::pool::Inner::run
12: std::sys_common::backtrace::__rust_begin_short_backtrace
13: core::ops::function::FnOnce::call_once{{vtable.shim}}
14: std::sys::pal::unix::thread::Thread::new::thread_start
15: start_thread
16: clone3)
Platform
Linux
Terminal Emulator
Alacritty with zellij
Installation Method
zypper (OpenSuse tumbleweed)
Helix Version
helix 24.3 (2cadec0b)
I know where in the code the crash occurs but I can't find anything wrong with it so we need more Information:
- what language are you using
- cab you share a file where this crash happened?
I know where in the code the crash occurs but I can't find anything wrong with it so we need more Information:
* what language are you using * cab you share a file where this crash happened?
- was in a large python file, around 3500 lines.
- no, code is from work.
Does your document contain carrige return (CR) linenedings (just \r instead of \r\n or \n)?
I think that's the most likely explanation for this and in that case I know how to fix this.
Hmm nevemind I guess I don't see crashes with CR in testing. I thought tree sitter counted those as newlines but we didn't. Not sure what exactly this is causing that it's pretty weird and I can't reproduce.
I checked file and are all \n. I think i also did a selection with mouse and yank (just find out it does an auto yank with mouse). Tried multiple combination of those actions and could not reproduce.
I have set the env RUST_BACKTRACE=full, don't know if that gives more details. Next time I will try to write down exact steps.
Can you increase the log verbosity? Maybe to see all commands/keybinds?
hx -vvv gets you max verbosity.
@krukas are you running any patches? I get this issue all the time because of some underlying bug that's exposed undo/redo and a patch I have that keeps the editor in insert mode always, but I've not bothered to rebase my fork & debug.
Also note that a fix for similar issue (#6645) was merged just after the 24.3 release. Maybe try that out?
@krukas are you running any patches? I get this issue all the time because of some underlying bug that's exposed undo/redo and a patch I have that keeps the editor in insert mode always, but I've not bothered to rebase my fork & debug.
Also note that a fix for similar issue (#6645) was merged just after the 24.3 release. Maybe try that out?
The panic message will not tell you anyrhing. If anyrhing goes wrong in the editor it usually ends up in a panic like that.
I know what code is causing it and there is very little that can go wrong there (nothing related to undo or the rendering system). Tree sitter ir producing an invalid point offset/we are reading it.
I will probably just fix this by removing the use of tree sitter points entirely and just always use byte positions instead
@krukas are you running any patches? I get this issue all the time because of some underlying bug that's exposed undo/redo and a patch I have that keeps the editor in insert mode always, but I've not bothered to rebase my fork & debug.
Also note that a fix for similar issue (#6645) was merged just after the 24.3 release. Maybe try that out?
I'm running 24.03 from Opensuse tumbleweed repo, don't know if some patches are applied to that.
The panic message will not tell you anything. If anything goes wrong in the editor it usually ends up in a panic like that.
Oops, I misread the panic message... :facepalm: that other issue is not similar, never mind.
had another crash after I selected text with mouse and used space+y, could not reproduce and this time it was a small .gitignore.rej file.
The file in question: .gitignore.rej.txt
thread 'main' panicked at /home/abuild/rpmbuild/BUILD/helix-24.03/vendor/ropey/src/slice.rs:360:41:
called `Result::unwrap()` on an `Err` value: Char index out of bounds: char index 396, Rope/RopeSlice char length 243
stack backtrace:
0: 0x55c5cb62aaed - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h3a3e14066d08445b
1: 0x55c5ca9d4350 - core::fmt::write::h635b969b0c73ca1c
2: 0x55c5cb635e53 - std::io::Write::write_fmt::h32a392dc332161f1
3: 0x55c5cb62a874 - std::sys_common::backtrace::print::haebafeedddb3c231
4: 0x55c5cb62ba90 - std::panicking::default_hook::{{closure}}::hbe6b35352e97edda
5: 0x55c5cb62b767 - std::panicking::default_hook::ha3d28f6760dc7873
6: 0x55c5cb62c0af - std::panicking::rust_panic_with_hook::hbe5a76d502748239
7: 0x55c5cb62bdfa - std::panicking::begin_panic_handler::{{closure}}::h4d6ed894446a10f5
8: 0x55c5cb62ad26 - std::sys_common::backtrace::__rust_end_short_backtrace::h5a53e39732234b5b
9: 0x55c5cb62bb54 - rust_begin_unwind
10: 0x55c5ca8e3105 - core::panicking::panic_fmt::h09f37a9c2cf6ceee
11: 0x55c5ca8e3043 - core::result::unwrap_failed::heb7cf98b365f9694
12: 0x55c5cac29828 - helix_core::graphemes::nth_prev_grapheme_boundary::he6fc00b2016c791d
13: 0x55c5caba631e - helix_core::selection::Range::grapheme_aligned::habc27d12e024d577
14: 0x55c5caba7fed - helix_core::selection::Selection::ensure_invariants::h7e5258b362caa693
15: 0x55c5cb3233a0 - helix_view::document::Document::set_selection::h634a854285e4fa64
16: 0x55c5cb1564dc - helix_term::ui::raw_regex_prompt::{{closure}}::h6857520fb59765f8
17: 0x55c5cb153e8d - <helix_term::ui::prompt::Prompt as helix_term::compositor::Component>::handle_event::h1e171bbd2cd0919e
18: 0x55c5cae2d565 - helix_term::compositor::Compositor::handle_event::ha996701f147846b1
19: 0x55c5cb3c8e3b - hx::main_impl::{{closure}}::hbd7a2969b05d8b56
20: 0x55c5cb3c641c - tokio::runtime::park::CachedParkThread::block_on::h2cd3f55f5a82dc98
21: 0x55c5cb44c386 - tokio::runtime::context::runtime::enter_runtime::ha97b7f446efa872c
22: 0x55c5cb41cd0c - tokio::runtime::runtime::Runtime::block_on::h3c252f1686fdf08e
23: 0x55c5cb44e893 - hx::main::hfa3be32ee38b15b1
24: 0x55c5cb43a243 - std::sys_common::backtrace::__rust_begin_short_backtrace::h38bba8e9a1cab6d1
25: 0x55c5cb4166dd - std::rt::lang_start::{{closure}}::hdc5b84c44b99049d
26: 0x55c5cb64df55 - std::rt::lang_start_internal::h84480a904ea3543b
27: 0x55c5cb44e985 - main
28: 0x7f6d5fe2a1f0 - __libc_start_call_main
29: 0x7f6d5fe2a2b9 - __libc_start_main@GLIBC_2.2.5
30: 0x55c5ca958ee5 - _start
31: 0x0 - <unknown>
I had the same on a larger file just now (from work, so unfortunately can't share); don't have a full backtrace at hand but will run with RUST_BACKTRACE=1 in future to catch it if it happens!
thread 'main' panicked at /private/tmp/nix-build-helix-24.03.drv-0/helix-24.03-vendor.tar.gz/ropey/src/slice.rs:360:41:
called `Result::unwrap()` on an `Err` value: Char index out of bounds: char index 19926, Rope/RopeSlice char length 9763
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
It's notable to me that the file is indeed 9763 characters long at time of crash, and that the OOB index is slightly (400 chars) more than 2x that.
File was TypeScript, with LSP on, and Helix is 24.03 from NixOS unstable (uses source directly from GitHub release with no patches applied).
I've noticed a similar issue on my machine. I didn't capture the RUST_BACKTRACE, but I know that, when I accept suggestions in Python (with pylsp) it deletes a character immediately after the insertion. If there isn't a character to delete, then it crashes. This is reproducible using the following steps:
hx example.py- In the resulting editor that opens, simply type
imp, and the editor suggestsimportas a keyword. Select the suggestion and observe as the last endline char is deleted. - Backspace the
import, and repeat step 2. - Helix crashes with the following error:
"""
thread 'main' panicked at /usr/share/cargo/registry/ropey-1.6.1/src/slice.rs:656:9:
Attempt to slice past end of RopeSlice: slice end 2, RopeSlice length 1
note: run with
RUST_BACKTRACE=1environment variable to display a backtrace """ Some version info: hx --version:helix 24.7 (079f5442)pylsp --version:pylsp v1.11.0On Fedora 40 (Sway) with Wezterm. Also included is a .gif of the terminal, to demo the bug:
That is almost certainly https://github.com/helix-editor/helix/issues/10689 instead