Bug 1762697

Summary: Segfault with invalid update-md-path
Product: [Fedora] Fedora Reporter: Lubomír Sedlář <lsedlar>
Component: createrepo_cAssignee: amatej
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: amatej, jmracek, jrohel, mblaha, pkratoch, rpm-software-management, tmlcoch
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: createrepo_c-0.15.11-1.fc32 createrepo_c-0.15.11-1.fc31 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-06-05 02:29:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lubomír Sedlář 2019-10-17 09:28:03 UTC
Description of problem:
When --update-md-path points to a location that is not a valid repo (empty dir, completely missing), createrepo_c segfaults.

Version-Release number of selected component (if applicable):
createrepo_c-0.15.1-1.fc30.x86_64

How reproducible:
100 %

Steps to Reproduce:
1. Have some RPMs in current directory
2. Run createrepo_c . --update --update-md-path=/i/dont/exist
3. See segfault

Actual results:
$ createrepo_c . --update --update-md-path=/i/dont/exist
Directory walk started
Directory walk done - 1 packages
Loading metadata from md-path: /i/dont/exist
C_CREATEREPOLIB: Warning: cr_get_local_metadata: /i/dont/exist is not a directory
Segmentation fault (core dumped [obraz paměti uložen])


Expected results:
It should not crash

Additional info:
I don't really expect this command to work, but clean exit would be better.

Comment 1 amatej 2020-01-09 14:34:56 UTC
I have created a PR that should fix this problem: https://github.com/rpm-software-management/createrepo_c/pull/197
And here is a PR that includes some tests for this case: https://github.com/rpm-software-management/ci-dnf-stack/pull/757

Comment 2 Ben Cotton 2020-04-30 20:25:49 UTC
This message is a reminder that Fedora 30 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 30 on 2020-05-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
Fedora 'version' of '30'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 30 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, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 3 Fedora Update System 2020-06-03 08:55:11 UTC
FEDORA-2020-f3f7292b39 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-f3f7292b39

Comment 4 Fedora Update System 2020-06-03 08:55:12 UTC
FEDORA-2020-a943fde9ba has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-a943fde9ba

Comment 5 Fedora Update System 2020-06-04 03:00:21 UTC
FEDORA-2020-f3f7292b39 has been pushed to the Fedora 31 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-f3f7292b39`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-f3f7292b39

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2020-06-04 04:08:28 UTC
FEDORA-2020-a943fde9ba has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-a943fde9ba`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-a943fde9ba

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2020-06-05 02:29:51 UTC
FEDORA-2020-a943fde9ba has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 8 Fedora Update System 2020-06-19 01:05:22 UTC
FEDORA-2020-f3f7292b39 has been pushed to the Fedora 31 stable repository.
If problem still persists, please make note of it in this bug report.