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 when closing last buffer with custom keymap #3626

Closed
statushub-piotr opened this issue Sep 1, 2022 · 5 comments · Fixed by #3633
Closed

Crash when closing last buffer with custom keymap #3626

statushub-piotr opened this issue Sep 1, 2022 · 5 comments · Fixed by #3633
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug

Comments

@statushub-piotr
Copy link

statushub-piotr commented Sep 1, 2022

Summary

I have following keymap defined:

[keys.normal]
  C-d = ":bc"

But when I'm closing a last buffer with C-d Helix is crashing:

RUST_BACKTRACE=1 RUST_BACKTRACE=full hx README.md
thread 'main' panicked at 'invalid HopSlotMap key used', helix-view/src/tree.rs:288:20
stack backtrace:
   0:        0x10e45b947 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hc80096156cd24709
   1:        0x10dc7a33b - core::fmt::write::hb6b947db0e571766
   2:        0x10e455abc - std::io::Write::write_fmt::h59c4febf5f8fcb1e
   3:        0x10e460c50 - std::panicking::default_hook::{{closure}}::h0e76f92bbb367061
   4:        0x10e460984 - std::panicking::default_hook::hbbbb8c05ad6cce9a
   5:        0x10e461306 - std::panicking::rust_panic_with_hook::ha581a2c99399f83b
   6:        0x10e1df82b - std::panicking::begin_panic::{{closure}}::h41d01fe56a0b19c5
   7:        0x10e1df517 - std::sys_common::backtrace::__rust_end_short_backtrace::h4e29a2b153903c5d
   8:        0x10e522b5d - std::panicking::begin_panic::h81195f939c0db72d
   9:        0x10e014efb - <helix_term::ui::editor::EditorView as helix_term::compositor::Component>::handle_event::h0823f16f448ab044
  10:        0x10dfee646 - helix_term::compositor::Compositor::handle_event::h32a2d9df0a93ad6f
  11:        0x10dfed543 - helix_term::application::Application::handle_terminal_events::h73d383291418c6a1
  12:        0x10e2d7fdc - helix_term::application::Application::event_loop_until_idle::{{closure}}::h77b9d46b13a822a7
  13:        0x10e2f6481 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::ha488495aca06aded
  14:        0x10e2cca8d - std::thread::local::LocalKey<T>::with::h84c497224506297b
  15:        0x10e2bb3f4 - tokio::park::thread::CachedParkThread::block_on::hdcb2e8f985168841
  16:        0x10e31a937 - tokio::runtime::thread_pool::ThreadPool::block_on::h99ed44c27b85a392
  17:        0x10e2d5b8f - tokio::runtime::Runtime::block_on::h853d17cafbb0ccea
  18:        0x10e2b0c79 - hx::main::h25800687aade73d2
  19:        0x10e2b3ed6 - std::sys_common::backtrace::__rust_begin_short_backtrace::h9c148213e879a372
  20:        0x10e2cc711 - std::rt::lang_start::{{closure}}::hf4e8ed626c558ffe
  21:        0x10e44f795 - std::rt::lang_start_internal::hdb19fe6764e59ca8
  22:        0x10e2b0d89 - _main

What is interesting is that when I'm closing the buffer with :bc the crash does not happens.

Reproduction Steps

  1. Open file - hx README.md
  2. Close buffer with custom keymap C-d (or any other combination mapped as ":bc"

Helix log

~/.cache/helix/helix.log
2022-09-01T09:04:16.956 helix_view::clipboard [INFO] Using pbcopy+pbpaste to interact with the system clipboard
2022-09-01T09:04:16.974 helix_view::editor [ERROR] Failed to initialize the LSP for `source.md` { LSP not defined }

Platform

macOS

Terminal Emulator

wezterm 20220807-113146-c2fee766 + tmux 3.2a

Helix Version

helix 22.08 (1cbf552)

@statushub-piotr statushub-piotr added the C-bug Category: This is a bug label Sep 1, 2022
@archseer
Copy link
Member

archseer commented Sep 1, 2022

Does this still happen on 5c2b77b ?

@statushub-piotr
Copy link
Author

Unfortunately yes, it still crashes.

@statushub-piotr
Copy link
Author

git bisect pointed 9e24f2a as the culprit.

@statushub-piotr statushub-piotr changed the title Crash when closing file with custom keymap Crash when closing last buffer with custom keymap Sep 1, 2022
@the-mikedavis the-mikedavis added the A-helix-term Area: Helix term improvements label Sep 1, 2022
@Flakebi
Copy link
Contributor

Flakebi commented Sep 1, 2022

I get the same without a custom keymap.
To reproduce

  1. Open an empty editor
  2. Press Ctrl+w, Ctrl+v to split the window
  3. Press Ctrl+w, Ctrl+q to close one window

And helix crashes.

@zancas
Copy link
Contributor

zancas commented Sep 1, 2022

Hi! I get:

thread 'main' panicked at 'invalid HopSlotMap key used', helix-view/src/tree.rs:288:20
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

When I try to close a window with C-w q.

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
5 participants