pop-os / cosmic-term

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

Panic on editing appearance #187

Open Koranir opened 7 months ago

Koranir commented 7 months ago

Running on EndeavourOS Hyprland using the cosmic-term-git AUR package, built around an hour ago.

Issue happens when changing any appearance setting, some better some worse.

If I switch the theme by: Ctrl+, -> Appearance -> Theme -> Selecting the theme (Match Desktop, Dark, Light), the application panics and crashes all instances. The panic only occurred when switching from Dark -> Match Desktop and vice versa, and switching to Light and back from the other themes had no issues.

Backtrace:

[koranir@korepc-lin rs]$ RUST_BACKTRACE=full cosmic-term
# After changing theme:
thread 'main' panicked at src/terminal_box.rs:356:58:
IndexSet: index out of bounds
stack backtrace:
   0:     0x5a2c716d6b26 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h410d4c66be4e37f9
   1:     0x5a2c71708880 - core::fmt::write::he40921d4802ce2ac
   2:     0x5a2c716d218f - std::io::Write::write_fmt::h5de5a4e7037c9b20
   3:     0x5a2c716d6904 - std::sys_common::backtrace::print::h11c067a88e3bdb22
   4:     0x5a2c716d8317 - std::panicking::default_hook::{{closure}}::h8c832ecb03fde8ea
   5:     0x5a2c716d8079 - std::panicking::default_hook::h1633e272b4150cf3
   6:     0x5a2c716d8818 - std::panicking::rust_panic_with_hook::hb164d19c0c1e71d4
   7:     0x5a2c716d86f2 - std::panicking::begin_panic_handler::{{closure}}::h0369088c533c20e9
   8:     0x5a2c716d7026 - std::sys_common::backtrace::__rust_end_short_backtrace::hc11d910daf35ac2e
   9:     0x5a2c716d8444 - rust_begin_unwind
  10:     0x5a2c71705c85 - core::panicking::panic_fmt::ha6effc2775a0749c
  11:     0x5a2c71705a33 - core::option::expect_failed::hea24986454718b4f
  12:     0x5a2c7083f650 - <cosmic_term::terminal_box::TerminalBox<Message> as iced_core::widget::Widget<Message,cosmic::theme::Theme,iced_renderer::Renderer>>::draw::{{closure}}::BgRect::fill::h2fbe86ac9578b17d
  13:     0x5a2c7093c240 - cosmic_term::terminal::Terminal::with_buffer::h6c3eef23c0eeef46
  14:     0x5a2c7083e1fd - <cosmic_term::terminal_box::TerminalBox<Message> as iced_core::widget::Widget<Message,cosmic::theme::Theme,iced_renderer::Renderer>>::draw::h5325d32b8cbb7555
  15:     0x5a2c708ecc7a - <iced_widget::column::Column<Message,Theme,Renderer> as iced_core::widget::Widget<Message,Theme,Renderer>>::draw::hf69e7177df3bff43
  16:     0x5a2c707f2380 - iced_widget::pane_grid::content::Content<Message,Theme,Renderer>::draw::h15e0f8750cdf779b
  17:     0x5a2c70782c84 - <iced_widget::pane_grid::PaneGrid<Message,Theme,Renderer> as iced_core::widget::Widget<Message,Theme,Renderer>>::draw::h0c3a7ca9d2938a51
  18:     0x5a2c707815ba - <iced_widget::row::Row<Message,Theme,Renderer> as iced_core::widget::Widget<Message,Theme,Renderer>>::draw::h609166600a9def54
  19:     0x5a2c708ecc7a - <iced_widget::column::Column<Message,Theme,Renderer> as iced_core::widget::Widget<Message,Theme,Renderer>>::draw::hf69e7177df3bff43
  20:     0x5a2c707245f9 - iced_runtime::user_interface::UserInterface<Message,Theme,Renderer>::draw::hca1d4c059dc50cc2
  21:     0x5a2c70880ed9 - iced_winit::multi_window::run_instance::{{closure}}::haf81973a251e5010
  22:     0x5a2c70889c76 - core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut::ha04b750cb6038caf
  23:     0x5a2c7086cd55 - winit::platform_impl::platform::wayland::event_loop::EventLoop<T>::pump_events::h81982d8881b820b6
  24:     0x5a2c7086e6eb - winit::platform_impl::platform::wayland::event_loop::EventLoop<T>::run_on_demand::hfdd4f18d99e9a49d
  25:     0x5a2c70884cdf - iced_winit::multi_window::run::he9e917962d701a86
  26:     0x5a2c709632cf - cosmic::app::run::h7056f9aae1543701
  27:     0x5a2c707b04a0 - cosmic_term::main::hc83dc8e9a575e8a9
  28:     0x5a2c708cef73 - std::sys_common::backtrace::__rust_begin_short_backtrace::h2d565369939652f4
  29:     0x5a2c707deeb9 - std::rt::lang_start::{{closure}}::haea2413e5a193ace
  30:     0x5a2c716c8f31 - std::rt::lang_start_internal::h4d236095b69a230b
  31:     0x5a2c707b09fc - main
  32:     0x740b1328dcd0 - <unknown>
  33:     0x740b1328dd8a - __libc_start_main
  34:     0x5a2c7071d865 - _start
  35:                0x0 - <unknown>
Koranir commented 7 months ago

Additionally, if multiple cosmic-term windows are open and one changes the background opacity setting, all other windows will panic with:

[koranir@korepc-lin ~]$ thread 'main' panicked at src/terminal_box.rs:356:58:
IndexSet: index out of bounds
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::option::expect_failed
   3: <cosmic_term::terminal_box::TerminalBox<Message> as iced_core::widget::Widget<Message,cosmic::theme::Theme,iced_renderer::Renderer>>::draw::{{closure}}::BgRect::fill
   4: cosmic_term::terminal::Terminal::with_buffer
   5: <cosmic_term::terminal_box::TerminalBox<Message> as iced_core::widget::Widget<Message,cosmic::theme::Theme,iced_renderer::Renderer>>::draw
   6: <iced_widget::column::Column<Message,Theme,Renderer> as iced_core::widget::Widget<Message,Theme,Renderer>>::draw
   7: iced_widget::pane_grid::content::Content<Message,Theme,Renderer>::draw
   8: <iced_widget::pane_grid::PaneGrid<Message,Theme,Renderer> as iced_core::widget::Widget<Message,Theme,Renderer>>::draw
   9: <iced_widget::row::Row<Message,Theme,Renderer> as iced_core::widget::Widget<Message,Theme,Renderer>>::draw
  10: <iced_widget::column::Column<Message,Theme,Renderer> as iced_core::widget::Widget<Message,Theme,Renderer>>::draw
  11: iced_runtime::user_interface::UserInterface<Message,Theme,Renderer>::draw
  12: iced_winit::multi_window::run_instance::{{closure}}
  13: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
  14: winit::platform_impl::platform::wayland::event_loop::EventLoop<T>::pump_events
  15: winit::platform_impl::platform::wayland::event_loop::EventLoop<T>::run_on_demand
  16: iced_winit::multi_window::run
  17: cosmic::app::run
  18: cosmic_term::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

(Background opacity also just turns the background black when turned up, which might not be intended behaviour)

Koranir commented 7 months ago

Changing the zoom steps or the light/dark color schemes just crashes all instances instantly with the same backtrace.