Bug 2383151

Summary: Running "sudo dnf upgrade --refresh" causes a segfault
Product: [Fedora] Fedora Reporter: Steve Storey <stevestorey>
Component: libdnfAssignee: rpm-software-management
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 42CC: daniel.mach, jmracek, jrohel, mblaha, pkratoch, rpm-software-management
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-07-24 06:11:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Steve Storey 2025-07-23 20:19:49 UTC
Just recently - certainly only within the last week - when running "sudo dnf upgrade --refresh" as a standard user, the repositories are refreshed, the upgrades are calculated, but when answering 'y' to 'Is this ok [y/N]' the program segfaults:

```
Total size of inbound packages is 355 MiB. Need to download 355 MiB.
After this operation, 1 MiB extra will be used (install 1 GiB, remove 1 GiB).
Is this ok [y/N]: y
Segmentation fault
```

`dmesg` shows the following output (from several attempts):

```
[295705.891892] traps: dnf[1521016] general protection fault ip:7f2ca8f4e07a sp:7ffd2bce4648 error:0 in libdnf5.so.2[14e07a,7f2ca8e00000+229000]
[295712.059071] traps: dnf[1521406] general protection fault ip:7f68f8b4e07a sp:7ffe28317e68 error:0 in libdnf5.so.2[14e07a,7f68f8a00000+229000]
[295722.719957] dnf[1521713]: segfault at 900000008 ip 00007f065634e074 sp 00007ffe6e77bb38 error 4 in libdnf5.so.2[14e074,7f0656200000+229000] likely on CPU 6 (core 6, socket 0)
[295722.719969] Code: c3 90 0f 1f 40 00 f3 0f 1e fa 48 8b 07 48 8b 78 68 48 81 c7 88 00 00 00 e9 59 fc f5 ff 90 0f 1f 84 00 00 00 00 00 f3 0f 1e fa <48> 8b 16 48 89 f8 f3 0f 6f 02 0f 12 c8 0f 11 00 66 48 0f 7e cf 48
[342357.162290] dnf[1757600]: segfault at 13e0000013d ip 00007f0c6074e074 sp 00007ffd82d8e928 error 4 in libdnf5.so.2[14e074,7f0c60600000+229000] likely on CPU 6 (core 6, socket 0)
[342357.162300] Code: c3 90 0f 1f 40 00 f3 0f 1e fa 48 8b 07 48 8b 78 68 48 81 c7 88 00 00 00 e9 59 fc f5 ff 90 0f 1f 84 00 00 00 00 00 f3 0f 1e fa <48> 8b 16 48 89 f8 f3 0f 6f 02 0f 12 c8 0f 11 00 66 48 0f 7e cf 48
[342440.269862] traps: dnf[1758804] general protection fault ip:7f02dcf4e074 sp:7ffc4d1eb728 error:0 in libdnf5.so.2[14e074,7f02dce00000+229000]
```

Running a last time without the --refresh then worked fine and seemed to apply the updates without problem. Running directly as root also seems to generally work (tho I think I have seen some errors then about 'weak pointers' but I'm afraid I didn't capture them)

Reproducible: Always

Steps to Reproduce:
1. Open a terminal (Konsole in my case)
2. Run 'sudo dnf upgrade --refresh'
3. Say 'y' to apply updates

Actual Results:
Total size of inbound packages is 355 MiB. Need to download 355 MiB.
After this operation, 1 MiB extra will be used (install 1 GiB, remove 1 GiB).
Is this ok [y/N]: y
Segmentation fault

Expected Results:
It should have applied the updates without the segfault

Additional Information:
Some information about installed versions that I hope will be helpful:

```
$ rpm -qa | egrep  '(dnf|^rpm-4)' | sort
dnf5-5.2.15.0-1.fc42.x86_64
dnf5-plugins-5.2.15.0-1.fc42.x86_64
dnf-data-4.23.0-1.fc42.noarch
dnf-plugins-core-4.10.1-1.fc42.noarch
dnf-utils-4.10.1-1.fc42.noarch
libdnf-0.74.0-1.fc42.x86_64
libdnf5-5.2.15.0-1.fc42.x86_64
libdnf5-cli-5.2.15.0-1.fc42.x86_64
libdnf5-plugin-expired-pgp-keys-5.2.15.0-1.fc42.x86_64
python3-dnf-4.23.0-1.fc42.noarch
python3-dnf-plugins-core-4.10.1-1.fc42.noarch
python3-dnf-plugins-extras-common-4.1.2-4.fc42.noarch
python3-dnf-plugin-versionlock-4.10.1-1.fc42.noarch
python3-libdnf-0.74.0-1.fc42.x86_64
python3-libdnf5-5.2.15.0-1.fc42.x86_64
rpm-4.20.1-1.fc42.x86_64
```

Comment 1 Pavla Kratochvilova 2025-07-24 06:11:27 UTC
Looks like a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=2381859

*** This bug has been marked as a duplicate of bug 2381859 ***