Fedora Account System
Red Hat Associate
Red Hat Customer
Description of problem: Started btop and it immediately crashed Version-Release number of selected component: btop-1.4.4-2.fc43 Additional info: reporter: libreport-2.17.15 crash_function: get_multiplier_from_str runlevel: /bin/sh: line 1: runlevel: command not found cgroup: 0::/user.slice/user-500.slice/user/app.slice/app-org.gnome.Terminal.slice/vte-spawn-5d3e87b4-2570-4834-8ece-59cddc196a4a.scope comment: Started btop and it immediately crashed executable: /usr/bin/btop kernel: 6.17.8-300.fc43.x86_64 package: btop-1.4.4-2.fc43 reason: btop killed by SIGABRT rootdir: / uid: 500 cmdline: btop backtrace_rating: 4 journald_cursor: s=7e61c392945b4be381e58244599e5446;i=10c1c76c;b=14a45ff6644b4c6bae91d69af113081f;m=84c5f40a;t=644a56e0cd33b;x=59d476af962f2f96 type: CCpp Truncated backtrace: Thread no. 1 (4 frames) #5 get_multiplier_from_str at /usr/src/debug/rocm-smi-6.4.3-1.fc43.x86_64/src/rocm_smi.cc:135 #7 freq_string_to_int at /usr/include/c++/15/bits/basic_string.h:238 #8 get_frequencies at /usr/src/debug/rocm-smi-6.4.3-1.fc43.x86_64/src/rocm_smi.cc:1141 #9 rsmi_dev_gpu_clk_freq_get at /usr/src/debug/rocm-smi-6.4.3-1.fc43.x86_64/src/rocm_smi.cc:1761 Potential duplicate: bug 2407163
Created attachment 2116543 [details] File: open_fds
Created attachment 2116544 [details] File: dso_list
Created attachment 2116545 [details] File: backtrace
Created attachment 2116546 [details] File: limits
Created attachment 2116547 [details] File: core_backtrace
Created attachment 2116548 [details] File: cpuinfo
Created attachment 2116549 [details] File: maps
Created attachment 2116550 [details] File: environ
Created attachment 2116551 [details] File: proc_pid_status
Created attachment 2116552 [details] File: mountinfo
Created attachment 2116553 [details] File: os_info
This was previously logged in bug 2264343 for F39 (I've used btop in F39 and F41 without issue though). Changing component to rocm-smi as per discussion there (which didn't go anywhere before F39 went EOL).
I note that Tom Rix closed the previous bug as NOTABUG. I don't believe that is correct. The evidence points to the rocm-smi parser having a bug. I think this should be escalated upstream ... so I did: https://github.com/ROCm/rocm_smi_lib/issues/231
I hit this same crash on Fedora 44 (rocm-smi-7.1.1, assertion at src/rocm_smi.cc:136) and did some digging into why it aborts the whole process instead of failing gracefully. I believe there are two independent issues here, and one of them is fixable right now in the Fedora package with a one-line spec change. Issue 1 (upstream, already tracked): the parser doesn't handle the index-less "current frequency" line the kernel intentionally emits in pp_dpm_mclk/pp_dpm_sclk when the current frequency doesn't match any DPM level (see bug 2264343 comment 13 and ROCm/rocm_smi_lib#231). That causes get_multiplier_from_str() to receive an unexpected character. Issue 2 (Fedora packaging — the actual reason for the SIGABRT): the Fedora build ships with assert() compiled in, because NDEBUG is never defined: - Fedora's %cmake macro does not set CMAKE_BUILD_TYPE, and rocm-smi.spec doesn't either. With an empty build type, CMake applies no per-config flags, so CMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" (which the %cmake macro defines precisely for this purpose) is never used. - Upstream's intent is clearly that this assert is a debug-only guard: the default case is assert(false); immediately followed by throw amd::smi::rsmi_exception(RSMI_STATUS_UNEXPECTED_DATA, ...), and every public API entry point is wrapped in TRY/CATCH macros that convert the exception into an error status. With NDEBUG defined, the assert compiles out, rsmi_dev_gpu_clk_freq_get() returns RSMI_STATUS_UNEXPECTED_DATA, and btop handles that gracefully (it just logs a warning and keeps running). If the assert were meant to stay in release builds, the throw right after it would be dead code. - Proof that the shipped library has live asserts is the crash message itself: the "Assertion `false' failed" text only exists in binaries built without NDEBUG. AMD's own packages (repo.radeon.com) and e.g. Arch Linux build this library with -DCMAKE_BUILD_TYPE=Release, which is why this abort is specific to the Fedora build. Suggested fix in rocm-smi.spec: %build +export CXXFLAGS="%{build_cxxflags} -DNDEBUG" %cmake \ -DBUILD_TESTS=%{build_test} \ This doesn't fix the parser (that's issue 1, upstream), but it restores the upstream-intended release behavior: a shared library returning an error to its caller instead of abort()ing the host process. It would turn this crash — and any future unexpected-data condition in the library — into a logged warning in btop. A note on the more obvious alternative, -DCMAKE_BUILD_TYPE=Release: I tried that first, and while it compiles correctly (-DNDEBUG plus the usual distro flags, -g included) and fixes the crash, the build then fails with "Empty %files file debugsourcefiles.list". Upstream's rocm_smi/CMakeLists.txt has a Release-only POST_BUILD rule that runs ${CMAKE_STRIP} on the freshly linked librocm_smi64.so (the spec's sed only cleans the top-level CMakeLists.txt, so it survives), leaving find-debuginfo with nothing to extract ("Extracting debug info from 0 files"). Exporting CXXFLAGS avoids that side effect entirely and keeps the binary identical to the current build except for the asserts. I rebuilt rocm-smi 7.1.1 in mock on Fedora 44 to verify: with NDEBUG defined, the build log shows -DNDEBUG on every compile line, and btop — which previously aborted on launch on this machine (Ryzen 5 5600G iGPU + RX dGPU) — now runs fine, including under 3D load. Side notes: other ROCm packages using the same spec pattern (no CMAKE_BUILD_TYPE) may also be shipping live asserts and could benefit from the same review. Bug 2477358 (filed against btop) looks like a duplicate of this one. I'm happy to open a dist-git PR with this change if that helps.
Opened a dist-git PR with the proposed fix (rawhide): https://src.fedoraproject.org/rpms/rocm-smi/pull-request/4 Verified in mock on rawhide (7.2.1): -DNDEBUG on all compile lines, debuginfo and debugsource intact, build exits 0. Happy to file the same change for f44 if that helps.
This is fixed. rocm-smi-7.1.1-4.fc44 went stable yesterday: https://bodhi.fedoraproject.org/updates/FEDORA-2026-69050651ef f45 has the same change in rocm-smi-7.2.1-4.fc45, and rawhide in 10.0.0-2. Verified on Fedora 44 with a Ryzen 5 5600G integrated GPU: btop previously aborted on startup with SIGABRT and now runs with GPU monitoring, including under load. The bug wasn't attached to the Bodhi updates, so it didn't close automatically.