Bug 2331665 - libcomps segfaults when iterating over and iterator from an iterator
Summary: libcomps segfaults when iterating over and iterator from an iterator
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: libcomps
Version: 41
Hardware: Unspecified
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2321657 2330927
TreeView+ depends on / blocked
 
Reported: 2024-12-11 10:39 UTC by Miro Hrončok
Modified: 2024-12-22 02:01 UTC (History)
8 users (show)

Fixed In Version: libcomps-0.1.21-4.fc42 libcomps-0.1.21-4.fc41
Clone Of:
Environment:
Last Closed: 2024-12-11 20:25:46 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Fedora Package Sources libcomps pull-request 8 0 None None None 2024-12-11 13:31:17 UTC
Fedora Package Sources libcomps pull-request 9 0 None None None 2024-12-11 13:31:17 UTC
Github rpm-software-management libcomps pull 116 0 None open Return self from iter(iterator) 2024-12-11 11:17:05 UTC

Internal Links: 2330562

Description Miro Hrončok 2024-12-11 10:39:48 UTC
This is pretty much the same thing as bz2330562 but for libcomps.

In Python 3.13.0:

>>> import libcomps
>>> i = libcomps.Comps()
>>> next(iter(iter(i.environments)))
Segmentation fault (core dumped)

This is with python3-libcomps-0.1.21-3.fc41.x86_64.


With Python 3.13.1 this code is called via dnf in https://github.com/rpm-software-management/dnf/blob/4.22.0/dnf/comps.py#L420

This causes anaconda to segfault and blocks update to Python 3.13.1.

Reproducible: Always

Comment 1 Miro Hrončok 2024-12-11 10:47:09 UTC
> >>> import libcomps
> >>> i = libcomps.Comps()
> >>> next(iter(iter(i.environments)))
> Segmentation fault (core dumped)

Or even:

>>> import libcomps
>>> i = libcomps.Comps()
>>> it = iter(i.environments)
>>> it2 = iter(it)
Segmentation fault (core dumped)

Comment 2 Miro Hrončok 2024-12-11 11:17:06 UTC
Upstream PR: https://github.com/rpm-software-management/libcomps/pull/116

Comment 3 Fedora Update System 2024-12-11 14:14:02 UTC
FEDORA-2024-63d5771cc9 (libcomps-0.1.21-4.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-63d5771cc9

Comment 4 Fedora Update System 2024-12-11 14:34:06 UTC
FEDORA-2024-3c18fe0d93 (libcomps-0.1.21-4.fc41, libdnf-0.73.4-2.fc41, and 2 more) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-3c18fe0d93

Comment 5 Fedora Update System 2024-12-11 20:25:46 UTC
FEDORA-2024-63d5771cc9 (libcomps-0.1.21-4.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 6 Fedora Update System 2024-12-12 02:40:11 UTC
FEDORA-2024-3c18fe0d93 has been pushed to the Fedora 41 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-3c18fe0d93`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-3c18fe0d93

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

Comment 7 Fedora Update System 2024-12-22 02:01:05 UTC
FEDORA-2024-3c18fe0d93 (libcomps-0.1.21-4.fc41, libdnf-0.73.4-2.fc41, and 2 more) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.


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