kakoc/birdy

Panicked because of "index out of bounds: the len is 14729604 but the index is 14735352"

Opened this issue · 4 comments

c02y commented
$ RUST_BACKTRACE=1 birdy
thread 'main' panicked at /home/chz/.cargo/registry/src/index.crates.io-6f17d22bba15001f/birdy-0.1.7/src/rectangle.rs:43:17:
index out of bounds: the len is 14729604 but the index is 14735352
stack backtrace:
   0: rust_begin_unwind
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/panicking.rs:595:5
   1: core::panicking::panic_fmt
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/panicking.rs:67:14
   2: core::panicking::panic_bounds_check
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/panicking.rs:162:5
   3: birdy::rectangle::draw_rect_filled
   4: birdy::Screenshot::draw
   5: birdy::main::{{closure}}
   6: winit::platform_impl::platform::x11::EventLoop<T>::run_return::single_iteration
   7: winit::platform_impl::platform::x11::EventLoop<T>::run
   8: winit::platform_impl::platform::EventLoop<T>::run
   9: birdy::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

FYI:

  • cargo install birdy
  • Arch Linux
  • X11
  • cargo 1.73.0 (9c4383fb5 2023-08-26)
  • rustc 1.73.0
kakoc commented

I wasn't able to directly reproduce your problem but I pushed a change which should prevent from such error.
BTW, can you share info about your display?

c02y commented

Not sure what exactly the display you were saying, but here is my xrandr result (only DP-0 is enabled):

$ xrandr
Screen 0: minimum 8 x 8, current 2560 x 1440, maximum 32767 x 32767
DP-0 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 597mm x 336mm
   2560x1440     59.95*+
   2048x1080     60.00    24.00
   1920x1080     60.00    59.94    50.00
   1600x1200     60.00
   1280x1024     75.02    60.02
   1280x720      60.00    59.94    50.00
   1152x864      75.00
   1024x768      75.03    60.00
   800x600       75.00    60.32
   720x576       50.00
   720x480       59.94
   640x480       75.00    59.94    59.93
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 connected (normal left inverted right x axis y axis)
   1920x1080    144.00 +

Yes, the latest birdy runs, but after that, my whole screen is completely black.

Hotkeys like b or f work since there is a mark cross symbol, after I Esc, nothing, no screenshot image is saved into my directory or saved to a clipboard.

kakoc commented

Hotkeys like b or f work since there is a mark cross symbol, after I Esc, nothing, no screenshot image is saved into my directory or saved to a clipboard.

Esc just exists without save. If you want to save to a clipboard press Enter.

Yes, the latest birdy runs, but after that, my whole screen is completely black.

Can you try to run several times(like 10) and check whether you always see a black screen or sometimes the actual screen captured?

c02y commented

f doesn't work at all, after Enter, b's result is put into my clipboard, check the attachment.

No matter how many times I tried birdy, my screen is always black, I cannot see anything.

image