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

Crash during editing of golang code #7454

Closed
mcdoker18 opened this issue Jun 26, 2023 · 3 comments
Closed

Crash during editing of golang code #7454

mcdoker18 opened this issue Jun 26, 2023 · 3 comments
Labels
C-bug Category: This is a bug

Comments

@mcdoker18
Copy link
Contributor

Summary

gopls - master branch

I got panic during editing of golang code. I think it is related with lsp somehow. Because after disabling it, panic doesn't occur.

thread 'main' panicked at 'Positions [(3518, After)] are out of range for changeset len 6958!', /home/mcdoker18/opensource/helix-editor/helix/helix-core/src/transaction.rs:413:9
stack backtrace:
   0:     0x55e0376c925d - std::backtrace_rs::backtrace::libunwind::trace::h9a6b80bbf328ba5d
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x55e0376c925d - std::backtrace_rs::backtrace::trace_unsynchronized::hd162ec543a11886b
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2:     0x55e0376c925d - std::sys_common::backtrace::_print_fmt::h78a5099be12f51a6
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x55e0376c925d - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::ha1c5390454d74f71
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x55e036cfd44f - core::fmt::write::h9ffde816c577717b
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/fmt/mod.rs:1254:17
   5:     0x55e0376c5155 - std::io::Write::write_fmt::h88186074961638e4
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/io/mod.rs:1698:15
   6:     0x55e0376c9035 - std::sys_common::backtrace::_print::h184198273ed08d59
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x55e0376c9035 - std::sys_common::backtrace::print::h1b4d8e7add699453
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x55e0376cad8e - std::panicking::default_hook::{{closure}}::h393bcea75423915a
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:269:22
   9:     0x55e0376cab6e - std::panicking::default_hook::h48c64f31d8b3fd03
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:288:9
  10:     0x55e0376cb3cf - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hb9b860f5a1175bda
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/alloc/src/boxed.rs:1987:9
  11:     0x55e0376cb3cf - std::panicking::rust_panic_with_hook::hafdc493a79370062
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:695:13
  12:     0x55e0376cb166 - std::panicking::begin_panic_handler::{{closure}}::h0a64bc82e36bedc7
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:582:13
  13:     0x55e0376c9766 - std::sys_common::backtrace::__rust_end_short_backtrace::hc203444fb7416a16
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:150:18
  14:     0x55e0376caf02 - rust_begin_unwind
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:578:5
  15:     0x55e036c343e3 - core::panicking::panic_fmt::h0f6ef0178afce4f2
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/panicking.rs:67:14
  16:     0x55e03742dee9 - helix_core::transaction::ChangeSet::update_positions::hae576fc3367ab4b2
  17:     0x55e03746ad19 - helix_view::document::Document::apply_impl::hc9dcbb50f8649bf3
  18:     0x55e03746bfaf - helix_view::document::Document::apply_inner::hbaee1a8334ecae2b
  19:     0x55e0370dd55d - helix_term::commands::insert::insert_char::hd6b73baf675eff33
  20:     0x55e0370a8625 - helix_term::ui::editor::EditorView::insert_mode::h4aad46c959b0f727
  21:     0x55e0370ab23c - <helix_term::ui::editor::EditorView as helix_term::compositor::Component>::handle_event::h8e5933fe2249c51e
  22:     0x55e037204989 - helix_term::compositor::Compositor::handle_event::hcf691a2b3b43bf59
  23:     0x55e0374f8f7a - tokio::runtime::context::BlockingRegionGuard::block_on::h3e49ec61362a6406
  24:     0x55e0375076cd - tokio::runtime::scheduler::multi_thread::MultiThread::block_on::h5dc4dfa48b4c1652
  25:     0x55e0375424bc - hx::main::h748739fb17973357
  26:     0x55e0374ea473 - std::sys_common::backtrace::__rust_begin_short_backtrace::h1c48b633c3cb3edd
  27:     0x55e0374cd08d - std::rt::lang_start::{{closure}}::h68f38cf1d9e05d3c
  28:     0x55e0376bfc45 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hb1327dc2ef3fecdf
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/ops/function.rs:287:13
  29:     0x55e0376bfc45 - std::panicking::try::do_call::h4044173225fe83dd
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:485:40
  30:     0x55e0376bfc45 - std::panicking::try::hd8a722c09d156a53
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:449:19
  31:     0x55e0376bfc45 - std::panic::catch_unwind::hd2ca07971cf0119b
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panic.rs:140:14
  32:     0x55e0376bfc45 - std::rt::lang_start_internal::{{closure}}::h26d89d595cf47b70
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/rt.rs:148:48
  33:     0x55e0376bfc45 - std::panicking::try::do_call::hf47aa1aa005e5f1a
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:485:40
  34:     0x55e0376bfc45 - std::panicking::try::h73d246b2423eaf4e
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:449:19
  35:     0x55e0376bfc45 - std::panic::catch_unwind::hbaaeae8f1b2f9915
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panic.rs:140:14
  36:     0x55e0376bfc45 - std::rt::lang_start_internal::h76f3e81e6b8f13f9
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/rt.rs:148:20
  37:     0x55e037542715 - main
  38:     0x7fda6f87eb4a - __libc_start_call_main
  39:     0x7fda6f87ec0b - __libc_start_main@@GLIBC_2.34
  40:     0x55e036c7e0b5 - _start
  41:                0x0 - <unknown>

Reproduction Steps

I don't have logs or example of code.

Helix log

No response

Platform

Linux

Terminal Emulator

alacritty

Helix Version

master

@mcdoker18 mcdoker18 added the C-bug Category: This is a bug label Jun 26, 2023
@pascalkuthe
Copy link
Member

This is a recent regression in #7408 the sorting of diagnostics was accidently removed which causes this crash (and other issues): d491e23#r119649981

@mcdoker18
Copy link
Contributor Author

Thanks for the quick response! I can confirm that after reverting the commit, it looks like that bug is not reproduced.

@archseer
Copy link
Member

v

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

3 participants