btop icon indicating copy to clipboard operation
btop copied to clipboard

[BUG] Exception while unlocking the Config lock

Open UtsavBalar1231 opened this issue 2 years ago • 6 comments

Describe the bug

After running btop and try to switch between different presets, there seems to be a crash during Config::unlock() which ends up with error key not found. Happens everytime on my PC while switching between different presets.

To Reproduce

  • Open btop
  • Use shortcut p to shift between presets
  • Crash after some arbitrary tries

Expected behavior

  • Should not crash with exception

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

OS: Arch Linux x86_64
Host: Nitro AN515-52 (V1.28)
Kernel: 6.6.8-arch1-1
Uptime: 58 mins
Packages: 1115 (pacman)
Shell: zsh 5.9
Display (AUO61ED): 1920x1080 @ 60Hz *
Display (VG240Y M3): 1920x1080 @ 180Hz
WM: i3 (X11)
Theme: Gruvbox-Material-Dark-HIDPI [GTK2/3]
Icons: Gruvbox-Plus-Dark [GTK2/3]
Font: FiraCode Nerd Font weight=450 (15pt) [GTK2/3]
Cursor: Bibata-Modern-Ice
Terminal: kitty 0.31.0
Terminal Font: FiraCodeNF-Reg (16pt)
CPU: Intel(R) Core(TM) i5-8300H (8) @ 4.00 GHz
GPU 1: Intel UHD Graphics 630
GPU 2: NVIDIA GeForce GTX 1050 Mobile
Memory: 2.73 GiB / 7.60 GiB (36%)
Swap: 512.00 KiB / 7.97 GiB (0%)
Disk (/): 98.91 GiB / 225.33 GiB (44%) - ext4
Local IP (wlan0): 192.168.0.124/24 *
Battery: 100% [Full]
Locale: en_US.UTF-8

Additional context

Contents of ~/.config/btop/btop.log

2023/12/25 (11:18:30) | ===> btop++ v.1.3.0
2023/12/25 (11:18:30) | DEBUG: Starting in DEBUG mode!
2023/12/25 (11:18:30) | INFO: Logger set to DEBUG
2023/12/25 (11:18:30) | DEBUG: Using locale en_US.UTF-8
2023/12/25 (11:18:30) | INFO: Running on /dev/pts/2
2023/12/25 (11:18:30) | DEBUG: Shared::init() : Initialized.
2023/12/25 (11:18:30) | DEBUG: Loading theme file: /usr/share/btop/themes/gruvbox_material_dark.theme
2023/12/25 (11:18:31) | DEBUG: Writing new config file
2023/12/25 (11:18:31) | ERROR: Exception during Config::unlock() : key not found
2023/12/25 (11:18:31) | INFO: Quitting! Runtime: 00:00:01

GDB Backtrace

Not able to get any trace from any thread. Even after compiling as Debug build.

(gdb) r --debug
Starting program: /home/utsav/dev/btop/bin/btop --debug
Downloading separate debug info for system-supplied DSO at 0x7ffff7fc8000                                                                         
[Thread debugging using libthread_db enabled]                                                                                                     
Using host libthread_db library "/usr/lib/libthread_db.so.1".
ERROR: Exception during Config::unlock() : key not found
[Thread 0x7fffeffff6c0 (LWP 62561) exited]
[Inferior 1 (process 62522) exited with code 01]
(gdb) thread apply all bt
(gdb) 

UtsavBalar1231 avatar Dec 25 '23 06:12 UtsavBalar1231

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.

rkowalsk avatar Jan 10 '24 11:01 rkowalsk

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

UtsavBalar1231 avatar Jan 10 '24 13:01 UtsavBalar1231

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

sliva0 avatar Feb 18 '24 20:02 sliva0

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

nico avatar Apr 10 '24 14:04 nico

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.

reukiodo avatar Apr 12 '24 14:04 reukiodo