bottom icon indicating copy to clipboard operation
bottom copied to clipboard

[Bug]: panic in src/canvas/widgets/disk_table.rs:66:31

Open popey opened this issue 3 years ago • 2 comments

Checklist

Describe the issue

btm crashed when the number of disks changed.

I had btm running in a terminal, and did a snap remove $foo $bar $baz elsewhere which results in some of the /snap/foo mount points disappearing. I suspect btm didn't like this.

thread '<unnamed>' panicked at 'range start index 17 out of range for slice of length 16', src/canvas/widgets/disk_table.rs:66:31

What operating system are you using?

Linux

What architecture are you using?

x86_64 / AMD64

What terminal(s) are you running bottom on?

Konsole Version 22.04.3 With byobu 5.133-1 running inside it. Resulting in it running in tmux 3.2a-4build1.

What version of bottom are you running?

0.6.8

How did you install bottom?

Official deb from releases page

How can we reproduce this?

  1. snap install firefox ncspot openspades
  2. btm
  3. snap remove firefox ncspot openspades

Additional information

Here's the output when it dies.

thread '<unnamed>' panicked at 'range start index 17 out of range for slice of length 16', src/canvas/widgets/disk_table.rs:66:31
   0: bottom::panic_hook
   1: std::panicking::rust_panic_with_hook
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:610:17
   2: std::panicking::begin_panic_handler::{{closure}}
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:502:13
   3: std::sys_common::backtrace::__rust_end_short_backtrace
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/sys_common/backtrace.rs:139:18
   4: rust_begin_unwind
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:498:5
   5: core::panicking::panic_fmt
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/panicking.rs:107:14
   6: core::slice::index::slice_start_index_len_fail
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/slice/index.rs:34:5
   7: <bottom::canvas::Painter as bottom::canvas::widgets::disk_table::DiskTableWidget>::draw_disk_table
   8: bottom::canvas::Painter::draw_widgets_with_constraints
   9: bottom::canvas::Painter::draw_data::{{closure}}
  10: bottom::try_drawing
  11: btm::main
  12: std::sys_common::backtrace::__rust_begin_short_backtrace
  13: main
  14: __libc_start_call_main
             at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  15: __libc_start_main_impl
             at ./csu/../csu/libc-start.c:392:3
  16: _start

popey avatar Jul 27 '22 13:07 popey

I think(?) this is already fixed in the main branch, I'll test later.

ClementTsang avatar Jul 27 '22 22:07 ClementTsang

Ah, remembered wrong - it's fixed in one of my in-progress PRs (#749). Will close this when that is resolved.

ClementTsang avatar Jul 28 '22 03:07 ClementTsang