macchina: [BUG] Macchina panicks due to index out of bounds
Describe the bug
Running machina
causes a panick in thread ‘main’ due to ‘index out of bounds: the len is 25000 but the index is 25026’ on version 0.9.2.
To Reproduce Steps to reproduce the behavior:
- Install latest version of macchina via
cargo install macchina
- run
macchina
to get a readout of the system and the panick will occur
Expected behavior Rather than showing the system readout the program panicks and doesn’t return the system stats.
Screenshots
Running machina by itself:
Running macchina with RUST_BACKTRACE=1:
Running macchina with RUST_BACKTRACE=full:
macchina --doctor
output
Macchina is run on a desktop so the battery cannot be found, this wasn’t an issue before so I don’t think it’s the root cause here.
System Information
- Distribution: Fedora 34 - kernel 5.13.10
- Desktop Environment GNOME 40.3.0
- Operating System Linux
- Terminal Tillix
- Macchina’s version 0.9.2
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 20 (13 by maintainers)
Looks like a readout issue which causes the buffer to overflow because too many lines are printed. This must be fixed in libmacchina @grtcdr
If I unplug one of the two monitors it seems to not crash anymore and dumps all the available resolutions that the display can handle:
My guess is that either something goes wrong with non-matching resolutions across different screens or multiple monitors in general with the Resolution flag enabled.
Yes, it works flawlessly now. Glad I could assist in fixing this!
It should be fixed now.
We could be misusing the
tui-rs
library somewhere in the code. I’ll check it out.