Open UtsavBalar1231 opened 10 months ago
The crash doesn't always occur while going through the presets. To make it appear, you can press 5 to enable the GPU view and then go through the presets.
Tried with GPU view as switching between presets, Same behavior as previous, it crashes arbitrarily.
btop.log
2024/01/10 (18:28:45) | ===> btop++ v.1.3.0
2024/01/10 (18:28:45) | WARNING: NVML: Failed to get maximum GPU power draw, defaulting to 225W: Not Supported
2024/01/10 (18:28:45) | WARNING: NVML: Failed to get GPU power usage: Not Supported
2024/01/10 (18:28:55) | ERROR: Exception during Config::unlock() : unordered_map::at
2024/01/10 (18:29:59) | ===> btop++ v.1.3.0
2024/01/10 (18:29:59) | WARNING: NVML: Failed to get maximum GPU power draw, defaulting to 225W: Not Supported
2024/01/10 (18:29:59) | WARNING: NVML: Failed to get GPU power usage: Not Supported
2024/01/10 (18:30:09) | ERROR: Exception during Config::unlock() : unordered_map::at
2024/01/10 (18:30:10) | ===> btop++ v.1.3.0
2024/01/10 (18:30:10) | WARNING: NVML: Failed to get maximum GPU power draw, defaulting to 225W: Not Supported
2024/01/10 (18:30:10) | WARNING: NVML: Failed to get GPU power usage: Not Supported
2024/01/10 (18:30:17) | ERROR: Exception during Config::unlock() : unordered_map::at
2024/01/10 (18:30:19) | ===> btop++ v.1.3.0
2024/01/10 (18:30:19) | WARNING: NVML: Failed to get maximum GPU power draw, defaulting to 225W: Not Supported
2024/01/10 (18:30:19) | WARNING: NVML: Failed to get GPU power usage: Not Supported
2024/01/10 (18:30:26) | ERROR: Exception during Config::unlock() : unordered_map::at
https://github.com/aristocratos/btop/assets/32286881/6b0944c0-06a2-480e-9b9f-af48886e02fa
I'm getting the same bug in the same circumstances (multiple p
presses on startup).
btop --version
:
btop version: 1.3.2
System information
OS: EndeavourOS Linux x86_64
Host: ROG Zephyrus G16 GU603ZV 1.0
Kernel: 6.7.4-zen1-1-zen
Packages: 1288 (pacman), 18 (flatpak)
Shell: bash 5.2.26
CPU: 12th Gen Intel i7-12700H (20) @ 4.600GHz
GPU: NVIDIA GeForce RTX 4060 Max-Q / Mobile
GPU: Intel Alder Lake-P
Memory: 15609MiB
~/.config/btop/btop.log
with DEBUG
level:
2024/02/18 (19:45:18) | ===> btop++ v.1.3.2
2024/02/18 (19:45:18) | INFO: Logger set to DEBUG
2024/02/18 (19:45:18) | DEBUG: Using locale en_IE.UTF-8
2024/02/18 (19:45:18) | INFO: Running on /dev/pts/0
2024/02/18 (19:45:20) | WARNING: NVML: Failed to get maximum GPU power draw, defaulting to 225W: Not Supported
2024/02/18 (19:45:20) | INFO: Failed to load librocm_smi64.so, AMD GPUs will not be detected: librocm_smi64.so.6: cannot open shared object file: No such file or directory
2024/02/18 (19:45:20) | DEBUG: Shared::init() : Initialized.
2024/02/18 (19:45:27) | DEBUG: Writing new config file
2024/02/18 (19:45:27) | ERROR: Exception during Config::unlock() : unordered_map::at
2024/02/18 (19:45:27) | INFO: Quitting! Runtime: 00:00:09
btop
package:
extra/btop 1.3.2-1
Same here, crashes immediately when opening it and keeping p
pressed:
$ btop --version
btop version: 1.3.0
$ time btop
ERROR: Exception during Config::unlock() : unordered_map::at
real 0m0.946s
user 0m0.080s
sys 0m0.291s
I can also reproduce the issue in v1.3.0, and though my RX560 GPU doesn't even show up in the charts, it seems to be detected as GPU settings are shown in the options menu. OP has a 1050Ti, so the issue isn't strictly restricted to AMD or nVidia GPUs.
The exception seems to be raised here: https://github.com/aristocratos/btop/blob/516979b2ae050a95a4bbd3928bc856e482a37097/src/btop_config.hpp#L110
Some keys are missing from strings
variable which raises std::out_of_range
when trying to use at()
method with missing key.
For me the easiest way to reproduce this was to add a preset "cpu:0:default,gpu0:0:default" and to try to switch to it. This caused an update to "graph_symbol_gpu0" key, which was not present in the map, crashing btop.
Simplest fix is to replace strings.at(name) = value;
with strings[name] = value;
, but I'm not sure this is a proper fix, maybe it breaks something else, or maybe the core issue is that not all values are added to the config, idk.
UPD: reproduction with a preset creates a slightly different error:
ERROR: Exception in main loop -> Input::process("P") : _Map_base::at
.
But I think that Config::unlock
one is caused by same issue, though you would need to replace all at()
's here to "fix" it.
Describe the bug
After running
btop
and try to switch between different presets, there seems to be a crash duringConfig::unlock()
which ends up with errorkey not found
. Happens everytime on my PC while switching between different presets.To Reproduce
p
to shift between presetsExpected behavior
Screenshots https://github.com/aristocratos/btop/assets/32286881/c56446f3-911c-4c27-bc6f-a952dd696236
Info (please complete the following information):
Btop version:
v1.3.0
(AUR as well as self-compiled) LLVM version:16.0.6
,LTO enabled
System information
Additional context
Contents of
~/.config/btop/btop.log
GDB Backtrace
Not able to get any trace from any thread. Even after compiling as Debug build.