Fedora Account System
Red Hat Associate
Red Hat Customer
Description of problem: I had heard how cool btop is, so I just installed it. The crash occurred on the very first attempt to use it (and every subsequent attempt). Version-Release number of selected component: btop-1.3.0-4.fc39 Additional info: reporter: libreport-2.17.11 type: CCpp reason: btop killed by SIGABRT journald_cursor: s=ebf36c8bf5b84d2793553a6245b7538f;i=a50bd;b=ef4aee87c54044cd8c0cc49ac8e91bf7;m=be705e9d4;t=61164c7e4d66a;x=7663e611266cecc1 executable: /usr/bin/btop cmdline: btop cgroup: 0::/user.slice/user-1000.slice/user/app.slice/app-org.gnome.Terminal.slice/vte-spawn-995e6d7b-f67d-4d18-8953-6361f546445d.scope rootdir: / uid: 1000 kernel: 6.7.4-200.fc39.x86_64 package: btop-1.3.0-4.fc39 runlevel: N 5 backtrace_rating: 4 crash_function: get_multiplier_from_str comment: I had heard how cool btop is, so I just installed it. The crash occurred on the very first attempt to use it (and every subsequent attempt). Truncated backtrace: Thread no. 1 (5 frames) #6 get_multiplier_from_str at /usr/src/debug/rocm-smi-5.7.1-1.fc39.x86_64/src/rocm_smi.cc:121 #8 freq_string_to_int at /usr/include/c++/13/bits/basic_string.h:222 #9 get_frequencies at /usr/src/debug/rocm-smi-5.7.1-1.fc39.x86_64/src/rocm_smi.cc:1068 #10 rsmi_dev_gpu_clk_freq_get at /usr/src/debug/rocm-smi-5.7.1-1.fc39.x86_64/src/rocm_smi.cc:1619 #11 Gpu::Rsmi::collect<true> at src/linux/btop_collect.cpp:1380
Created attachment 2016795 [details] File: proc_pid_status
Created attachment 2016796 [details] File: maps
Created attachment 2016797 [details] File: limits
Created attachment 2016798 [details] File: environ
Created attachment 2016799 [details] File: open_fds
Created attachment 2016800 [details] File: mountinfo
Created attachment 2016801 [details] File: os_info
Created attachment 2016802 [details] File: cpuinfo
Created attachment 2016803 [details] File: core_backtrace
Created attachment 2016804 [details] File: dso_list
Created attachment 2016805 [details] File: backtrace
The backtrace points to rocm-smi as the probable culprit. I'll try to debug it tomorrow if nobody beats me to it.
This is definitely a rocm-smi bug. Reassigning the component. In freq_string_to_int, we have: fs = " 1066Mhz *" ind = 1066 freq = 0 junk = "Mhz" units_str = "" star_str = "" multiplier = <optimized out> The empty units_str means that this line: long double multiplier = get_multiplier_from_str(units_str[0]); passes the terminating null character to get_multiplier_from_str, which leads directly to the assertion failure. Moving up one level to get_frequencies, we have: val_vec = std::vector of length 3, capacity 4 = {"2: 400Mhz ", "3: 1067Mhz ", " 1066Mhz *"} So something went awry with reading frequencies for my GPU, which is an Asus AMD Radeon RX 6500 XT. GDB shows that it first reads from /sys/class/drm/card0/device/pp_dm_sclk, which has these contents: 0: 200Mhz 1: 400Mhz * 2: 2000Mhz Then it reads from /sys/class/drm/card0/device/pp_dpm_mclk, which has these contents: 2: 400Mhz 3: 1067Mhz 1066Mhz * And that is where its string parsing algorithm breaks down, because the 3rd line does not start with 'n:' for some integer n.
My mistake. That Radeon 6500 XT is card1; card0 is the builtin GPU on an AMD Ryzen 7 5700G.
does > cat /sys/class/drm/card0/device/pp_dpm_mclk Have the same offset index / missing index ? If sysfs is misformatted, isn't this a kernel issue ?
(In reply to Tom Rix from comment #15) > does > > > cat /sys/class/drm/card0/device/pp_dpm_mclk > > Have the same offset index / missing index ? Yes: $ cat /sys/class/drm/card0/device/pp_dpm_mclk 2: 400Mhz 3: 1067Mhz 1066Mhz * > If sysfs is misformatted, isn't this a kernel issue ? Is it a sysfs formatting bug, or a failure of rocm-smi to parse the output correctly? I took a look in the Linux 6.7.6 source tree and found places where this format is printed in: - vangogh_print_legacy_clk_levels (drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c): the !cur_value_match_level case at the bottom - vangogh_print_clk_levels (drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c): the !cur_value_match_level case near the bottom - renoir_print_clk_levels (drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c): the !cur_value_match_level case at the bottom
Misformatted sysfs is a kernel issue.
If you think that the sysfs output is misformatted, by all means reassign this bug to the kernel component. To me it looks like the kernel developers decided to represent the case where the current frequency is not the same as any clock level, and rocm-smi does not correctly parse that case. This format has been around for at least 3 years; e.g., see https://github.com/torvalds/linux/commit/ae7b32e7c30268196e1b3c61e0dcb50b4e842f39; search for "if (!cur_value_match_level)". It shows up in several places under drivers/gpu/drm/amd/pm/swsmu in the Linux kernel source tree.
This message is a reminder that Fedora Linux 39 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 39 on 2024-11-26. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of '39'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see it. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 39 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed.
This still occurs in F43 - bug 2417737 created