Bug 1761779 - dnf segfaults when running repolist
Summary: dnf segfaults when running repolist
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: libdnf
Version: 30
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jaroslav Rohel
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-10-15 11:13 UTC by Pavla Kratochvilova
Modified: 2019-10-17 06:53 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2019-10-17 06:53:45 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Output from valgrind (4.77 KB, text/plain)
2019-10-15 11:13 UTC, Pavla Kratochvilova
no flags Details

Description Pavla Kratochvilova 2019-10-15 11:13:41 UTC
Created attachment 1625947 [details]
Output from valgrind

Description of problem:
DNF segfaults when running repolist (or e.g. install/upgrade/downgrade, but not e.g. mark/group/clean).

Version-Release number of selected component (if applicable):
I used the following copr repo: https://copr.fedorainfracloud.org/coprs/rpmsoftwaremanagement/dnf-nightly

# rpm -q libdnf dnf dnf-plugins-core
librepo-1.10.7-0.6gc842ff0.fc30.x86_64
libdnf-0.35.6-0.23g0999bcc7.fc30.x86_64
dnf-4.2.12-0.37ge22bf67b.fc30.noarch

How reproducible:
Always.

Steps to Reproduce:
1. # dnf install libdnf-0.35.6-0.23g0999bcc7.fc30.x86_64
2. # dnf repolist
Segmentation fault (core dumped)

Additional info:
Based on the time of the libdnf build, I think the libdnf contains commits up to this one: https://github.com/rpm-software-management/libdnf/commit/0999bcc7f8303bfeada691e0148377c016e29d86
I cannot reproduce it with newer libdnf version.
I can also provide coredump, but it's too big to add as attachement.

Comment 1 Daniel Mach 2019-10-15 19:57:33 UTC
I'm unable to reproduce it in podman with following Dockerfile:

FROM fedora:30
RUN dnf -y makecache
RUN dnf -y install dnf-plugins-core
RUN dnf -y copr enable rpmsoftwaremanagement/dnf-nightly
RUN dnf -y makecache
RUN dnf -y install libdnf-0.35.6-0.23g0999bcc7.fc30

$ podman run -it <hash> dnf repolist

Could you try it in podman by yourself? Can you tweak the Dockerfile so it creates the same dnf configuration and repo configuration as your system?

Comment 2 Pavla Kratochvilova 2019-10-16 06:03:27 UTC
I managed to reproduce it with the following Dockerfile:

FROM fedora:30
RUN dnf -y makecache
RUN dnf -y install dnf-plugins-core
RUN dnf -y copr enable rpmsoftwaremanagement/dnf-nightly
RUN dnf -y makecache
RUN dnf -y install dnf-4.2.12-0.43g64fbb431.fc30.noarch \
  dnf-4.2.12-0.43g64fbb431.fc30 \
  dnf-plugins-core-4.0.10-4g58e8f15.fc30 \
  libcomps-0.1.11-12g919c0e2.fc30 \
  libdnf-0.36.0-0.32g77a14f6a.fc30 \
  librepo-1.10.7-0.9g5c30597.fc30 \
  libsolv-0.7.6-6ga94facb0.fc30
RUN dnf -y install libdnf-0.35.6-0.23g0999bcc7.fc30

However, I wasn't sure how to build with podman, so I used docker instead; I hope that's ok (but I can learn with podman and check if it's the same).
Also, "sudo docker run -it <hash> dnf repolist" didn't output anything, but running "sudo docker run -it <hash>" and then "dnf repolist" in the container produced the segfault.


Additionally, I encountered a different error with the following Dockerfile:

FROM fedora:30
RUN dnf -y makecache
RUN dnf -y install dnf-plugins-core
RUN dnf -y copr enable rpmsoftwaremanagement/dnf-nightly
RUN dnf -y makecache
RUN dnf -y install libdnf-0.36.0-0.32g77a14f6a.fc30

# sudo docker run -it <hash> dnf repolist
Error: Unknown option
Error: Unknown option

Comment 3 Pavla Kratochvilova 2019-10-16 06:43:14 UTC
I found even smaller reproducer:

FROM fedora:30
RUN dnf -y makecache
RUN dnf -y install dnf-plugins-core
RUN dnf -y copr enable rpmsoftwaremanagement/dnf-nightly
RUN dnf -y makecache
RUN dnf -y install librepo-1.10.7-0.9g5c30597.fc30

Comment 4 Jaroslav Rohel 2019-10-17 06:53:45 UTC
The bug was in librepo. I made a fix PR: https://github.com/rpm-software-management/librepo/pull/175

The bug affects only dnf-nightly builds (wasn't released). Fix was merged to upstream librepo. I will close the bug.


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