btop icon indicating copy to clipboard operation
btop copied to clipboard

[BUG] GPU mode, resizing the terminal will cause a crash.

Open holdjun opened this issue 1 year ago • 1 comments

Describe the bug

ERROR: Exception in runner thread -> Cpu:: -> deque::_M_range_check: __n (which is 5)>= this->size() (which is 4)

截屏2024-01-29 19 47 15

When the terminal's window becomes smaller than a certain size, it will crash. It is caused by the GPU reality; if the GPU is turned off, it won't crash.

To Reproduce

[Steps to reproduce the behavior:]

Expected behavior

[A clear and concise description of what you expected to happen.]

Screenshots

[If applicable, add screenshots to help explain your problem.] 截屏2024-01-29 19 36 11

Additional context

2024/01/29 (19:37:45) | ===> btop++ v.1.3.0 2024/01/29 (19:37:45) | ERROR: Exception in runner thread -> Cpu:: -> deque::_M_range_check: __n (which is 3)>= this->size() (which is 2)

2024/01/29 (19:37:56) | ===> btop++ v.1.3.0 2024/01/29 (19:37:56) | ERROR: Exception in runner thread -> Cpu:: -> deque::_M_range_check: __n (which is 5)>= this->size() (which is 4)

GDB Backtrace

截屏2024-01-29 19 39 25 截屏2024-01-29 19 57 03

holdjun avatar Jan 29 '24 11:01 holdjun

It seems like only a maximum of 6 GPU is supported by btop. There's a preset pre-validate code in btop_config.cpp:L402-434, once the resize func is used, the config preset is validated through the code, causing the problem.

Cloud0310 avatar Jul 02 '24 04:07 Cloud0310