Bug 1041577 - hy_package_get_hdr_chksum() fails for some installed packages
Summary: hy_package_get_hdr_chksum() fails for some installed packages
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: libsolv
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Radek Holy
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1039415 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-12 17:57 UTC by Richard Hughes
Modified: 2015-10-06 02:14 UTC (History)
7 users (show)

Fixed In Version: libsolv-0.4.1-0.gita8e47f1.fc20
Clone Of:
Environment:
Last Closed: 2013-12-20 02:06:35 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
small reproducer (1.59 KB, text/x-csrc)
2013-12-12 17:57 UTC, Richard Hughes
no flags Details

Description Richard Hughes 2013-12-12 17:57:12 UTC
Created attachment 835970 [details]
small reproducer

Description of problem:

PackageKit uses hy_package_get_hdr_chksum() to work out the package ID so that it can remove the yumdb database entry when a package is removed. For the yumdb, the index is the rpm checksum of the header.

When removing packages, there's about a 1/10 chance that the chosen package will fail, although I've not worked out what makes some packages have a checksum, and others notso. Feel free to tell me I'm a moron if I'm misusing the API somehow.

Version-Release number of selected component (if applicable):

hawkey-0.4.6-1.fc20.x86_64

How reproducible:

Mostly. I've attached a small reproducer which you might have to tweak for your system which always fails to get the ID.

Steps to Reproduce:
1. gcc -o hy hy.c `pkg-config --cflags --libs hawkey`
2. ./hy

Actual results:
LOOKING FOR rhythmbox
NO HDR CHECKSUM for rhythmbox

Expected results:
LOOKING FOR rhythmbox
CHECKSUM xxxxxxxxxxxxxxxxxxxxxxxx

Comment 1 Ales Kozumplik 2013-12-16 07:51:19 UTC
Thanks for the report Richard. Radek does this sound familiar considering what you are chasing in bug 1039415?

Comment 2 Radek Holy 2013-12-16 11:35:44 UTC
Yes, I am pretty sure this bug is the cause of the bug 1039415.

Comment 3 Ales Kozumplik 2013-12-16 13:38:37 UTC
Assigning to Radek. Radek---ask if you get in trouble/have questions. It is possible libsolv is reading wrong data from rpmdb, in that case show the bug to Michael (mls) with as much information as possible, preferably with a reproducer. He has no obligation to fix libsolv bugs we find but is always very helpful.

Comment 4 Ales Kozumplik 2013-12-16 14:36:19 UTC
Radek tells me that reverting 61355e53 in hawkey helps, the change was to use repo_add_rpmdb_reffp() instead of plain repo_add_rpmdb() when re-reading rpmdb. Likely a libsolv bug.

CCing Michael.

Comment 5 Richard Hughes 2013-12-16 15:47:38 UTC
Found and fixed by mls in upstream libsolv:

commit a8e47f15b81002c721fe164885d809562c5d3e7a
Author: Michael Schroeder <mls>
Date:   Mon Dec 16 15:57:11 2013 +0100

    Also copy the checksums in repo_add_rpmdb_reffp
    
    Sorry. Also bumps the RPMDB_COOKIE_VERSION so old broken solv
    files don't get reused.

:100644 100644 16457db... 9d6d830... M  ext/repo_rpmdb.c

Comment 6 Fedora Update System 2013-12-16 17:11:45 UTC
libsolv-0.4.1-0.gita8e47f1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/libsolv-0.4.1-0.gita8e47f1.fc20

Comment 7 Radek Holy 2013-12-17 13:49:51 UTC
*** Bug 1039415 has been marked as a duplicate of this bug. ***

Comment 8 Fedora Update System 2013-12-17 19:12:11 UTC
Package libsolv-0.4.1-0.gita8e47f1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing libsolv-0.4.1-0.gita8e47f1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-23509/libsolv-0.4.1-0.gita8e47f1.fc20
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2013-12-20 02:06:35 UTC
libsolv-0.4.1-0.gita8e47f1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, 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.