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 on “close all buffers without quitting” command #2646

Closed
aral opened this issue Jun 2, 2022 · 2 comments
Closed

Crash on “close all buffers without quitting” command #2646

aral opened this issue Jun 2, 2022 · 2 comments
Labels
C-bug Category: This is a bug

Comments

@aral
Copy link
Contributor

aral commented Jun 2, 2022

Summary

I tried the close all buffers without quitting command and it crashed.

Reproduction Steps

  1. Open a few buffers
  2. Try the command mentioned above

What should happen

It should not crash.

What actually happens

It crashes:

❯ RUST_BACKTRACE=full hx .
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', helix-view/src/editor.rs:633:51
stack backtrace:
   0:     0x5639cd8462a4 - std::backtrace_rs::backtrace::libunwind::trace::h22893a5306c091b4
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x5639cd8462a4 - std::backtrace_rs::backtrace::trace_unsynchronized::h29c3bc6f9e91819d
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x5639cd8462a4 - std::sys_common::backtrace::_print_fmt::he497d8a0ec903793
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x5639cd8462a4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h9c2a9d2774d81873
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x5639cd12b76c - core::fmt::write::hba4337c43d992f49
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/fmt/mod.rs:1194:17
   5:     0x5639cd83fd15 - std::io::Write::write_fmt::heb73de6e02cfabed
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/io/mod.rs:1655:15
   6:     0x5639cd84814e - std::sys_common::backtrace::_print::h63c8b24acdd8e8ce
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x5639cd84814e - std::sys_common::backtrace::print::h426700d6240cdcc2
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x5639cd84814e - std::panicking::default_hook::{{closure}}::hc9a76eed0b18f82b
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:295:22
   9:     0x5639cd847e7d - std::panicking::default_hook::h2e88d02087fae196
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:314:9
  10:     0x5639cd70228b - helix_term::application::Application::run::{{closure}}::{{closure}}::h12d44a26b16c4ad5
  11:     0x5639cd8487db - std::panicking::rust_panic_with_hook::habfdcc2e90f9fd4c
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:702:17
  12:     0x5639cd8485dc - std::panicking::begin_panic_handler::{{closure}}::he054b2a83a51d2cd
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:586:13
  13:     0x5639cd8467d4 - std::sys_common::backtrace::__rust_end_short_backtrace::ha48b94ab49b30915
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys_common/backtrace.rs:138:18
  14:     0x5639cd84836d - rust_begin_unwind
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:584:5
  15:     0x5639cd0b0d53 - core::panicking::panic_fmt::h366d3a309ae17c94
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/panicking.rs:143:14
  16:     0x5639cd0b0c1d - core::panicking::panic::h8705e81f284be8a5
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/panicking.rs:48:5
  17:     0x5639cd668b51 - helix_view::editor::Editor::replace_document_in_view::h38aaf47a9206eac0
  18:     0x5639cd66a2e5 - helix_view::editor::Editor::close_document::h667e61d73b64ffb1
  19:     0x5639cd46e051 - helix_term::commands::typed::buffer_close_all::hfe23ffbde33b3c2f
  20:     0x5639cd55d7bc - helix_term::commands::MappableCommand::execute::h4e961bef968a04f4
  21:     0x5639cd5b80d4 - helix_term::commands::command_palette::{{closure}}::{{closure}}::h73efe48d6f5ae341
  22:     0x5639cd5ceaab - <helix_term::ui::picker::Picker<T> as helix_term::compositor::Component>::handle_event::h42d45acb7882ba82
  23:     0x5639cd51a597 - <helix_term::ui::overlay::Overlay<T> as helix_term::compositor::Component>::handle_event::hcae8e2558e3092b6
  24:     0x5639cd488871 - helix_term::compositor::Compositor::handle_event::h44595494eda1b0f4
  25:     0x5639cd42b9ae - helix_term::application::Application::handle_terminal_events::h8c7f5825c5f0b97e
  26:     0x5639cd6fe3e5 - helix_term::application::Application::event_loop::{{closure}}::h455c71991fc9a5cb
  27:     0x5639cd713629 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h4aff422bd5ed82f2
  28:     0x5639cd6e2802 - std::thread::local::LocalKey<T>::with::h68203639b5e723f2
  29:     0x5639cd6d8bd8 - tokio::park::thread::CachedParkThread::block_on::hc62f258db2ec3bc9
  30:     0x5639cd6cb3e3 - tokio::runtime::thread_pool::ThreadPool::block_on::he68c9450f117fde0
  31:     0x5639cd6f1550 - tokio::runtime::Runtime::block_on::h0be5f107588a71ae
  32:     0x5639cd6ad57d - hx::main::h55147127aa9b3379
  33:     0x5639cd6d2f43 - std::sys_common::backtrace::__rust_begin_short_backtrace::h19d108ced6e85bb1
  34:     0x5639cd6e251d - std::rt::lang_start::{{closure}}::h86db281d33c9137e
  35:     0x5639cd83a5ab - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::had4f69b3aefb47a8
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/ops/function.rs:259:13
  36:     0x5639cd83a5ab - std::panicking::try::do_call::hf2ad5355fcafe775
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:492:40
  37:     0x5639cd83a5ab - std::panicking::try::h0a63ac363423e61e
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:456:19
  38:     0x5639cd83a5ab - std::panic::catch_unwind::h18088edcecb8693a
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panic.rs:137:14
  39:     0x5639cd83a5ab - std::rt::lang_start_internal::{{closure}}::ha7dad166dc711761
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/rt.rs:128:48
  40:     0x5639cd83a5ab - std::panicking::try::do_call::hda0c61bf3a57d6e6
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:492:40
  41:     0x5639cd83a5ab - std::panicking::try::hbc940e68560040a9
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:456:19
  42:     0x5639cd83a5ab - std::panic::catch_unwind::haed0df2aeb3fa368
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panic.rs:137:14
  43:     0x5639cd83a5ab - std::rt::lang_start_internal::h9c06694362b5b80c
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/rt.rs:128:20
  44:     0x5639cd6ad6a2 - main
  45:     0x7fbbfb724d90 - <unknown>
  46:     0x7fbbfb724e40 - __libc_start_main
  47:     0x5639cd0e1005 - _start
  48:                0x0 - <unknown>

Helix log

There’s nothing from around that time in the Helix log.

Platform

Linux (Fedora Silverblue 36)

Terminal Emulator

GNOME Console

Helix Version

helix 22.05 (fc8c488)

@aral aral added the C-bug Category: This is a bug label Jun 2, 2022
@CptPotato
Copy link
Contributor

related: #2367

@the-mikedavis
Copy link
Member

Yeah let's close in favor of #2367 since the backtrace leads to the same place. I'll note the new reproduction case there

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