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 in ropey/src/slice.rs:360:41 in Helix 22.12 #6049

Closed
charles-dyfis-net opened this issue Feb 18, 2023 · 2 comments
Closed

Panic in ropey/src/slice.rs:360:41 in Helix 22.12 #6049

charles-dyfis-net opened this issue Feb 18, 2023 · 2 comments
Labels
C-bug Category: This is a bug

Comments

@charles-dyfis-net
Copy link

Summary

Alas, I'm not able to reliably reproduce this -- hopefully the stack trace is sufficient to be useful.

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Char index out of bounds: char index 2332, Rope/RopeSlice char length 1322', /private/tmp/nix-build-helix-22.12.drv-0/helix-22.12-vendor.tar.gz/ropey/src/slice.rs:360:41
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: helix_core::graphemes::nth_prev_grapheme_boundary
   4: helix_core::selection::Range::grapheme_aligned
   5: helix_core::selection::Selection::ensure_invariants
   6: helix_view::document::Document::set_selection
   7: helix_term::ui::regex_prompt::{{closure}}
   8: <helix_term::ui::prompt::Prompt as helix_term::compositor::Component>::handle_event
   9: helix_term::compositor::Compositor::handle_event
  10: helix_term::application::Application::run::{{closure}}
  11: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
  12: tokio::runtime::park::CachedParkThread::block_on
  13: tokio::runtime::scheduler::multi_thread::MultiThread::block_on
  14: tokio::runtime::runtime::Runtime::block_on
  15: hx::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Reproduction Steps

N/A: Unable to reproduce

Helix log

~/.cache/helix/helix.log

Unfortunately, there's very little content in helix.log in the seconds surrounding the error. (Previously there are several panics from rnix-lsp, but these are from well before the relevant point-in-time, and appear to be from completely different editor sessions).

2023-02-18T16:09:44.509 helix_term::application [WARN] lsp position out of bounds - Diagnostic { range: Range { start: Position { line: 32, character: 0 }, end: Position { line: 32, character: 0 } }, severity: Some(Error), code: Some(String("syntax_error")), code_description: None, source: None, message: "Expecting \";\"", related_information: Some([]), tags: Some([]), data: None }
2023-02-18T16:09:44.510 helix_term::application [WARN] lsp position out of bounds - Diagnostic { range: Range { start: Position { line: 32, character: 0 }, end: Position { line: 32, character: 0 } }, severity: Some(Error), code: Some(String("syntax_error")), code_description: None, source: None, message: "Expecting \"}\"", related_information: Some([]), tags: Some([]), data: None }
2023-02-18T16:09:44.666 helix_term::application [WARN] lsp position out of bounds - Diagnostic { range: Range { start: Position { line: 33, character: 0 }, end: Position { line: 33, character: 0 } }, severity: Some(Error), code: Some(String("syntax_error")), code_description: None, source: None, message: "Expecting \";\"", related_information: Some([]), tags: Some([]), data: None }
2023-02-18T16:09:44.666 helix_term::application [WARN] lsp position out of bounds - Diagnostic { range: Range { start: Position { line: 33, character: 0 }, end: Position { line: 33, character: 0 } }, severity: Some(Error), code: Some(String("syntax_err
or")), code_description: None, source: None, message: "Expecting \"}\"", related_information: Some([]), tags: Some([]), data: None }

Platform

MacOS 13.1, with Helix installed via Nix (from the nixpkgs unstable channel)

Terminal Emulator

iTerm2 3.4.19

Helix Version

helix 22.12

@charles-dyfis-net charles-dyfis-net added the C-bug Category: This is a bug label Feb 18, 2023
@the-mikedavis
Copy link
Member

We would need a reproduction case to debug this properly but based on the backtrace I think this is #5632. I will close in favor of that but feel free to re-open or open a new issue if you find a reproduction case for this.

@the-mikedavis the-mikedavis closed this as not planned Won't fix, can't repro, duplicate, stale Feb 19, 2023
@charles-dyfis-net
Copy link
Author

Looks consistent -- I did indeed have a vertical split when this took place.

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

No branches or pull requests

2 participants