Bug 2417737 - [abrt] btop: get_multiplier_from_str(): btop killed by SIGABRT
Summary: [abrt] btop: get_multiplier_from_str(): btop killed by SIGABRT
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: rocm-smi
Version: 43
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jonathan Wright
QA Contact:
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:083d36f92e0018a7e10ae7d335f...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-11-28 18:24 UTC by Russell Odom
Modified: 2026-10-08 16:07 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)
File: open_fds (237 bytes, text/plain)
2025-11-28 18:24 UTC, Russell Odom
no flags Details
File: dso_list (889 bytes, text/plain)
2025-11-28 18:24 UTC, Russell Odom
no flags Details
File: backtrace (28.13 KB, text/plain)
2025-11-28 18:24 UTC, Russell Odom
no flags Details
File: limits (1.29 KB, text/plain)
2025-11-28 18:24 UTC, Russell Odom
no flags Details
File: core_backtrace (4.80 KB, text/plain)
2025-11-28 18:24 UTC, Russell Odom
no flags Details
File: cpuinfo (3.54 KB, text/plain)
2025-11-28 18:24 UTC, Russell Odom
no flags Details
File: maps (3.84 KB, text/plain)
2025-11-28 18:24 UTC, Russell Odom
no flags Details
File: environ (4.86 KB, text/plain)
2025-11-28 18:24 UTC, Russell Odom
no flags Details
File: proc_pid_status (1.47 KB, text/plain)
2025-11-28 18:24 UTC, Russell Odom
no flags Details
File: mountinfo (6.37 KB, text/plain)
2025-11-28 18:24 UTC, Russell Odom
no flags Details
File: os_info (630 bytes, text/plain)
2025-11-28 18:24 UTC, Russell Odom
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github ROCm rocm_smi_lib issues 231 0 None open [Issue]: assertion failure while parsing sysfs 2025-11-29 03:22:40 UTC
Red Hat Bugzilla 2264343 0 unspecified CLOSED rocm-smi: assertion failure with builtin AMD GPU 2025-11-28 18:32:22 UTC

Description Russell Odom 2025-11-28 18:24:09 UTC
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

Comment 1 Russell Odom 2025-11-28 18:24:12 UTC
Created attachment 2116543 [details]
File: open_fds

Comment 2 Russell Odom 2025-11-28 18:24:13 UTC
Created attachment 2116544 [details]
File: dso_list

Comment 3 Russell Odom 2025-11-28 18:24:15 UTC
Created attachment 2116545 [details]
File: backtrace

Comment 4 Russell Odom 2025-11-28 18:24:16 UTC
Created attachment 2116546 [details]
File: limits

Comment 5 Russell Odom 2025-11-28 18:24:17 UTC
Created attachment 2116547 [details]
File: core_backtrace

Comment 6 Russell Odom 2025-11-28 18:24:18 UTC
Created attachment 2116548 [details]
File: cpuinfo

Comment 7 Russell Odom 2025-11-28 18:24:19 UTC
Created attachment 2116549 [details]
File: maps

Comment 8 Russell Odom 2025-11-28 18:24:20 UTC
Created attachment 2116550 [details]
File: environ

Comment 9 Russell Odom 2025-11-28 18:24:21 UTC
Created attachment 2116551 [details]
File: proc_pid_status

Comment 10 Russell Odom 2025-11-28 18:24:22 UTC
Created attachment 2116552 [details]
File: mountinfo

Comment 11 Russell Odom 2025-11-28 18:24:23 UTC
Created attachment 2116553 [details]
File: os_info

Comment 12 Russell Odom 2025-11-28 18:32:23 UTC
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).

Comment 13 Jerry James 2025-11-29 03:22:41 UTC
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

Comment 14 Igor Giamoniano 2026-07-17 00:05:33 UTC
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.

Comment 15 Igor Giamoniano 2026-07-28 22:17:17 UTC
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.

Comment 16 Igor Giamoniano 2026-10-08 16:07:41 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.