pop-os / cosmic-term

WIP COSMIC terminal emulator
GNU General Public License v3.0
396 stars 74 forks source link

(BUG) Panic when splits become too small #252

Open SekoiaTree opened 4 months ago

SekoiaTree commented 4 months ago

Reproduction method:

This happens whenever any minimum-size (in either dimension) split attempts to split further.

With RUST_BACKTRACE=1:


[2024-07-21T19:44:34Z WARN  cosmic_text::font::system] failed to load font 'MathJax_Vector-Regular'
[2024-07-21T19:44:34Z WARN  cosmic_text::font::system] failed to load font 'MathJax_Vector-Bold'
[2024-07-21T19:44:34Z WARN  cosmic_text::font::system] failed to load font 'MathJax_Vector-Regular'
[2024-07-21T19:44:34Z WARN  cosmic_text::font::system] failed to load font 'MathJax_Vector-Bold'
[2024-07-21T19:44:34Z WARN  wgpu_hal::gles::adapter] Detected skylake derivative running on mesa i915. Clears to srgb textures will use manual shader clears.
[2024-07-21T19:44:34Z WARN  wgpu_hal::gles::adapter] Detected skylake derivative running on mesa i915. Clears to srgb textures will use manual shader clears.
thread 'PTY reader' panicked at /build/cosmic-term-3aJqrI/cosmic-term-0.1.0~1718207407~22.04~7c02b9c/vendor/alacritty_terminal/src/term/mod.rs:258:19:
index out of bounds: the len is 0 but the index is 18446744073709551615
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread 'main' panicked at /build/cosmic-term-3aJqrI/cosmic-term-0.1.0~1718207407~22.04~7c02b9c/vendor/alacritty_terminal/src/term/mod.rs:258:19:
index out of bounds: the len is 0 but the index is 18446744073709551615
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[2024-07-21T19:44:37Z WARN  cosmic_term::terminal] Failed to send shutdown message on dropped terminal: sending on a closed channel```

Possibly related to #54 (which couldn't be reproduced).
thecardinelli commented 3 months ago

I see the issue when I create a lot of splits, and I try to resize one of the small splits over the other. Tested from master.

stack backtrace: 0: 0x596ed690a9e6 - std::backtrace_rs::backtrace::libunwind::trace::hbee8a7973eeb6c93 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5 1: 0x596ed690a9e6 - std::backtrace_rs::backtrace::trace_unsynchronized::hc8ac75eea3aa6899 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 2: 0x596ed690a9e6 - std::sys_common::backtrace::_print_fmt::hc7f3e3b5298b1083 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:68:5 3: 0x596ed690a9e6 - ::fmt::hbb235daedd7c6190 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:44:22 4: 0x596ed693bd70 - core::fmt::rt::Argument::fmt::h76c38a80d925a410 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/fmt/rt.rs:142:9 5: 0x596ed693bd70 - core::fmt::write::h3ed6aeaa977c8e45 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/fmt/mod.rs:1120:17 6: 0x596ed6906a6f - std::io::Write::write_fmt::h78b18af5775fedb5 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/io/mod.rs:1810:15 7: 0x596ed690a7c4 - std::sys_common::backtrace::_print::h5d645a07e0fcfdbb at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:47:5 8: 0x596ed690a7c4 - std::sys_common::backtrace::print::h85035a511aafe7a8 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:34:9 9: 0x596ed690c1d7 - std::panicking::default_hook::{{closure}}::hcce8cea212785a25 10: 0x596ed690bf39 - std::panicking::default_hook::hf5fcb0f213fe709a at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:292:9 11: 0x596ed690c668 - std::panicking::rust_panic_with_hook::h095fccf1dc9379ee at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:779:13 12: 0x596ed690c542 - std::panicking::begin_panic_handler::{{closure}}::h032ba12139b353db at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:657:13 13: 0x596ed690aee6 - std::sys_common::backtrace::rust_end_short_backtrace::h9259bc2ff8fd0f76 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:171:18 14: 0x596ed690c2a0 - rust_begin_unwind at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5 15: 0x596ed55f8425 - core::panicking::panic_fmt::h784f20a50eaab275 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14 16: 0x596ed55f8662 - core::panicking::panic_bounds_check::h8331054858f0bf20 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:208:5 17: 0x596ed56a868b - alacritty_terminal::term::Term::damage::h64d3a31af7ee0dd9 18: 0x596ed5639bc9 - cosmic_term::terminal::Terminal::update::h6ba965ea7e8e85f0 19: 0x596ed5882079 - <cosmic_term::terminal_box::TerminalBox as iced_core::widget::Widget<Message,cosmic::theme::Theme,iced_renderer::Renderer>>::draw::hf83b314cb9c85d0b 20: 0x596ed573b6ba - <iced_widget::column::Column<Message,Theme,Renderer> as iced_core::widget::Widget<Message,Theme,Renderer>>::draw::h7defbb3a8380d4c5 21: 0x596ed585997c - <iced_widget::pane_grid::PaneGrid<Message,Theme,Renderer> as iced_core::widget::Widget<Message,Theme,Renderer>>::draw::{{closure}}::h6642b01a788e7bf1 22: 0x596ed5858e63 - <iced_widget::pane_grid::PaneGrid<Message,Theme,Renderer> as iced_core::widget::Widget<Message,Theme,Renderer>>::draw::h8c311e8b94bdb703 23: 0x596ed573abda - <iced_widget::row::Row<Message,Theme,Renderer> as iced_core::widget::Widget<Message,Theme,Renderer>>::draw::h898026249ede31cb 24: 0x596ed573b6ba - <iced_widget::column::Column<Message,Theme,Renderer> as iced_core::widget::Widget<Message,Theme,Renderer>>::draw::h7defbb3a8380d4c5 25: 0x596ed58288c4 - iced_runtime::user_interface::UserInterface<Message,Theme,Renderer>::draw::h8b3d46ca2dddc1ef 26: 0x596ed57ec420 - iced_winit::multi_window::run_instance::{{closure}}::h044bd0b9e55d3400 27: 0x596ed5805d53 - core::ops::function::impls::<impl core::ops::function::FnMut for &mut F>::call_mut::h3e1b95df40e693ec 28: 0x596ed579e110 - winit::platform_impl::platform::wayland::event_loop::EventLoop::pump_events::ha1ced30dd5bbf524 29: 0x596ed579fb9b - winit::platform_impl::platform::wayland::event_loop::EventLoop::run_on_demand::h7a9a55e89a88ff42 30: 0x596ed57f1fc2 - iced_winit::multi_window::run::h838196067f6bd0b1 31: 0x596ed577a355 - cosmic_term::main::h3179679904f8ce12 32: 0x596ed5659a53 - std::sys_common::backtrace::rust_begin_short_backtrace::h5efe79f49ae57dee 33: 0x596ed5830a99 - std::rt::lang_start::{{closure}}::h7c4eb559483ee613 34: 0x596ed68fdbe1 - core::ops::function::impls::<impl core::ops::function::FnOnce for &F>::call_once::h37600b1e5eea4ecd at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:284:13 35: 0x596ed68fdbe1 - std::panicking::try::do_call::hb4bda49fa13a0c2b at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:552:40 36: 0x596ed68fdbe1 - std::panicking::try::h8bbf75149211aaaa at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516:19 37: 0x596ed68fdbe1 - std::panic::catch_unwind::h8c78ec68ebea34cb at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14 38: 0x596ed68fdbe1 - std::rt::lang_start_internal::{{closure}}::hffdf44a19fd9e220 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:148:48 39: 0x596ed68fdbe1 - std::panicking::try::do_call::hcb3194972c74716d at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:552:40 40: 0x596ed68fdbe1 - std::panicking::try::hcdc6892c5f0dba4c at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516:19 41: 0x596ed68fdbe1 - std::panic::catch_unwind::h4910beb4573f4776 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14 42: 0x596ed68fdbe1 - std::rt::lang_start_internal::h6939038e2873596b at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:148:20 43: 0x596ed577a8f5 - main 44: 0x7d406e829d90 - 45: 0x7d406e829e40 - __libc_start_main 46: 0x596ed55f8e45 - _start 47: 0x0 - [2024-08-16T20:47:21Z WARN cosmic_term::terminal] Failed to send shutdown message on dropped terminal: sending on a closed channel ^C