wicket can crash in response to a terminal resize

Open
#3,279 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust
Domain
cli

Research direction

Start by reproducing the crash in wicket's update pane while repeatedly resizing the terminal, then trace the render path through RunnerCore::handle_event, UpdatePane::draw, draw_status_view, Popup::render, and Fade::render. Use the tui Buffer::get or Paragraph bounds-check backtrace to identify the failing resize case; done means the same resize sequence no longer panics.

Written by the indexing model from the issue text.

Description

@rmustacc ran into this doing a mupdate on madrid (he's running a tiling window manager), and I can recreate it locally: start wicket, move to the update pane (unclear if it's specific to the update pane, but I've only reproduced it here), and then spam resize the terminal. It will eventually crash with a backtrace along the lines of:

 fffff5ffeeec918a _lwp_kill () + a
 fffff5ffeee5b742 raise (6) + 22
 fffff5ffeee34f88 abort () + 58
 0000000001666849 panic_abort::__rust_start_panic::abort::h06dcefd1f291a344 () + 9
 0000000001666839 __rust_start_panic () + 9
 0000000001651d5c rust_panic () + 1c
 0000000001651bc4 std::panicking::rust_panic_with_hook::h00e8572658b0c4cf () + 2c4
 00000000016518e6 std::panicking::begin_panic_handler::{{closure}}::h09d7d75e45edb255 () + c6
 000000000164ec00 std::sys_common::backtrace::__rust_end_short_backtrace::hd9a34a0abd284b36 () + 20
 0000000001651601 rust_begin_unwind () + 71
 00000000016a8d23 core::panicking::panic_fmt::hafca58ffacdb5036 () + 33
 00000000016a8ee6 core::panicking::panic_bounds_check::hf0d1380fa9f2a7f4 () + 66
 0000000000c53f1b tui::buffer::Buffer::get::h450167e3f3b21254 () + 3b
 0000000000bafa14 <wicket::ui::widgets::fade::Fade as tui::widgets::Widget>::render::hc06612ca299e6a12 () + a4
 0000000000c176b0 <wicket::ui::widgets::popup::Popup as tui::widgets::Widget>::render::h2158eb580d22d05a () + 30
 0000000000b1d4c5 <wicket::ui::panes::update::UpdatePane as wicket::ui::controls::Control>::draw::hc63b07805f256e4b () + 4465
 0000000000b9883f wicket::ui::main::MainScreen::draw_pane::h215baca2dbaaaeeb () + 15f
 0000000000bbc7dd tui::terminal::Terminal<B>::draw::h4eb35594a11689ca () + 24d
 0000000000c13180 wicket::runner::RunnerCore::handle_event::h7e948ad0cd5c87fc () + 510
 0000000000c148e7 wicket::runner::Runner::run::h5eb2cf6c64395026 () + 6b7
 0000000000aed51c wicket::dispatch::exec::h2290367353af60fe () + 15c
 0000000000ae0dd6 std::sys_common::backtrace::__rust_begin_short_backtrace::hb83ffc1d4d149de5 () + 6
 0000000000ae0e91 std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::h1a53b42a9673b33d (.llvm.16880298711526873463) () + 11
 00000000016321d6 std::rt::lang_start_internal::h378d4da2138bd7b1 () + 2c6
 0000000000ae0dbc main () + 2c
 0000000000ae0cb7 _start_crt () + 87
 0000000000ae0c18 _start () + 18

or

#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007fefa1b7a859 in __GI_abort () at abort.c:79
#2  0x000055ebbd676717 in panic_abort::__rust_start_panic::abort () at library/panic_abort/src/lib.rs:42
#3  0x000055ebbd676706 in panic_abort::__rust_start_panic () at library/panic_abort/src/lib.rs:37
#4  0x000055ebbd666b8c in std::panicking::rust_panic () at library/std/src/panicking.rs:740
#5  0x000055ebbd666ac7 in std::panicking::rust_panic_with_hook () at library/std/src/panicking.rs:710
#6  0x000055ebbd666809 in std::panicking::begin_panic_handler::{{closure}} () at library/std/src/panicking.rs:579
#7  0x000055ebbd66547c in std::sys_common::backtrace::__rust_end_short_backtrace () at library/std/src/sys_common/backtrace.rs:137
#8  0x000055ebbd666512 in rust_begin_unwind () at library/std/src/panicking.rs:575
#9  0x000055ebbd6896e3 in core::panicking::panic_fmt () at library/core/src/panicking.rs:64
#10 0x000055ebbd6898d2 in core::panicking::panic_bounds_check () at library/core/src/panicking.rs:159
#11 0x000055ebbd298bfb in <tui::widgets::paragraph::Paragraph as tui::widgets::Widget>::render ()
#12 0x000055ebbd1e2ddf in wicket::ui::panes::update::UpdatePane::draw_status_view ()
#13 0x000055ebbd1e6579 in <wicket::ui::panes::update::UpdatePane as wicket::ui::controls::Control>::draw ()
#14 0x000055ebbd266176 in wicket::ui::main::MainScreen::draw_pane ()
#15 0x000055ebbd151f71 in tui::terminal::Terminal<B>::draw ()
#16 0x000055ebbd165b1b in wicket::runner::RunnerCore::handle_event ()
#17 0x000055ebbd1672af in wicket::runner::Runner::run ()
#18 0x000055ebbd28a1fb in wicket::dispatch::exec ()
#19 0x000055ebbd12a173 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
#20 0x000055ebbd12a18d in std::rt::lang_start::{{closure}} ()
#21 0x000055ebbd657e6c in core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once () at library/core/src/ops/function.rs:287
Dominant language
Rust
Stars
572
Forks
97
Avg merge
2d 12h
Merged PRs (30d)
96

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from oxidecomputer/omicron

All issues in oxidecomputer/omicron

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.