Bug 111276 - rpm db corrupted / rpm --rebuilddb seg fault
rpm db corrupted / rpm --rebuilddb seg fault
Status: CLOSED WORKSFORME
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
9
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-12-01 12:46 EST by morgan
Modified: 2007-04-18 12:59 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-12-05 11:00:54 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description morgan 2003-12-01 12:46:44 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007

Description of problem:
The RPM DB is corrupted, and I don't manage to rebuild it.
I followed the instructions on www.rpm.org/hintskinks/repairdb/
and www.rpm.org/hintskinks/repairdb-2003-06/ without any success

> cd /var/lib/rpm
> rm -f /var/lib/rpm/__db*
> /usr/lib/rpm/rpmdb_verify Packages
db_verify: Page 7165: overflow page of invalid type 0
db_verify: DB->verify: Packages-ORIG: DB_VERIFY_BAD: Database
verification failed

> rpm --rebuilddb
==> seg fault

> mv Packages Packages-ORIG
> /usr/lib/rpm/rpmdb_dump Packages-ORIG | /usr/lib/rpm/rpmdb_load Packages
> /usr/lib/rpm/rpmdb_verify Packages
==> Now ok !
> rpm -qa
==> seg fault
> rpm --rebuilddb
==> seg fault

(I did a backup of /var/lib/rpm before trying to rebuild DB)


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

How reproducible:
Always

Steps to Reproduce:
1.rpm -qa
2.rpm --rebuilddb -vv


    

Actual Results:  1. lists the package, some "error: rpmdbNextIterator:
skipping h#     787 Header V3 DSA signature: BAD, key ID e42d547b",
ends with
segmentation fault

2.rpm --rebuilddb
error: rpmdbNextIterator: skipping h#     746 blob size(2232): BAD, 8
+ 16 * il(75) + dl(21956)
error: rpmdbNextIterator: skipping h#     787 Header V3 DSA signature:
BAD, key ID e42d547b
error: rpmdbNextIterator: skipping h#     787 Header V3 DSA signature:
BAD, key ID e42d547b
error: rpmdbNextIterator: skipping h#     787 Header V3 DSA signature:
BAD, key ID e42d547b
error: rpmdbNextIterator: skipping h#     787 Header V3 DSA signature:
BAD, key ID e42d547b
error: rpmdbNextIterator: skipping h#     787 Header V3 DSA signature:
BAD, key ID e42d547b
error: rpmdbNextIterator: skipping h#     787 Header V3 DSA signature:
BAD, key ID e42d547b
error: rpmdbNextIterator: skipping h#     787 Header V3 DSA signature:
BAD, key ID e42d547b
error: rpmdbNextIterator: skipping h#     787 Header V3 DSA signature:
BAD, key ID e42d547b
error: rpmdbNextIterator: skipping h#     787 Header V3 DSA signature:
BAD, key ID e42d547b
error: rpmdbNextIterator: skipping h#     787 Header V3 DSA signature:
BAD, key ID e42d547b
Segmentation fault (core dumped)


Additional info:
Comment 1 Jeff Johnson 2003-12-01 12:51:48 EST
Try removing the pubkey (watch for typos):
    rpm -e gpg-pubkey-e42d547b
and doing --rebuilddb. Does that fix?
Comment 2 morgan 2003-12-02 04:46:06 EST
The package is not installed
> rpm -e gpg-pubkey-e42d547b
error: package gpg-pubkey-e42d547b is not installed

> rpm -qa | grep pubkey
error: rpmdbNextIterator: skipping h#     746 blob size(2232): BAD, 8
+ 16 * il(75) + dl(21956)
error: rpmdbNextIterator: skipping h#     787 Header V3 DSA signature:
BAD, key ID e42d547b
error: rpmdbNextIterator: skipping h#     787 Header V3 DSA signature:
BAD, key ID e42d547b
error: rpmdbNextIterator: skipping h#     787 Header V3 DSA signature:
BAD, key ID e42d547b
error: rpmdbNextIterator: skipping h#     787 Header V3 DSA signature:
BAD, key ID e42d547b
error: rpmdbNextIterator: skipping h#     787 Header V3 DSA signature:
BAD, key ID e42d547
Comment 3 Jeff Johnson 2003-12-02 05:58:05 EST
Hmmm, what pubkeys do you have imported? "rpm -qa gpg-pubkey"
will show.

Alternatively, try "rpm --rebuilddb --nosignature -vv" to disable
signature verification.
Comment 4 morgan 2003-12-02 06:11:23 EST
>rpm -qa gpg-pubkey
error: rpmdbNextIterator: skipping h#     746 blob size(2232): BAD, 8
+ 16 * il(75) + dl(21956)
error: rpmdbNextIterator: skipping h#     787 Header V3 DSA signature:
BAD, key ID e42d547b
error: rpmdbNextIterator: skipping h#     787 Header V3 DSA signature:
BAD, key ID e42d547b
error: rpmdbNextIterator: skipping h#     787 Header V3 DSA signature:
BAD, key ID e42d547b
error: rpmdbNextIterator: skipping h#     787 Header V3 DSA signature:
BAD, key ID e42d547b
error: rpmdbNextIterator: skipping h#     787 Header V3 DSA signature:
BAD, key ID e42d547b
Segmentation fault (core dumped)

> rpm --rebuilddb --nosignature -vv
....
D: adding "71fb9de450284e82757ab4547b1c4b900165e9ff" to Sha1header index.
D: adding 22 entries to Filemd5s index.
Segmentation fault (core dumped)
Comment 5 morgan 2003-12-02 08:06:15 EST
Five packages are affected by the "BAD, key ID". Do I need to update
the key (and how to do that) ?
>rpm -qa --nosignature gpg-pubkey
error: rpmdbNextIterator: skipping h#     746 blob size(2232): BAD, 8
+ 16 * il(75) + dl(21956)
gpg-pubkey-db42a60e-37ea5438

And is the error above due to the KEY pb ?  It happens "between" two
package:
> rpm -qa --nosignature
...
passivetex-1.21-2
error: rpmdbNextIterator: skipping h#     746 blob size(2232): BAD, 8
+ 16 * il(75) + dl(21956)
gkrellm-2.1.5-3
...

> rpm -V gkrellm-2.1.5-3 passivetex-1.21-2
=> ok
> rpm -qa --nosignature passivetex
passivetex-1.21-2
error: rpmdbNextIterator: skipping h#     746 blob size(2232): BAD, 8
+ 16 * il(75) + dl(21956)
> rpm -qa --nosignature gkrellm
error: rpmdbNextIterator: skipping h#     746 blob size(2232): BAD, 8
+ 16 * il(75) + dl(21956)
gkrellm-2.1.5-3
Comment 6 morgan 2003-12-03 11:04:19 EST
I don't know how I can help....
I installed the key needed by some packages
> rpm --import RPM-GPG-KEY
> rpm --nosignature -qa gpg*
error: rpmdbNextIterator: skipping h#     746 blob size(2232): BAD, 8
+ 16 * il(75) + dl(21956)
gpg-pubkey-e42d547b-3960bdf1
gpg-pubkey-db42a60e-37ea5438


The problem is still there:
> rpm -Kvv alsa-utils-0.9.8-1.fr.i386.rpm
D: Expected size:       110849 = lead(96)+sigs(344)+pad(0)+data(110409)
D:   Actual size:       110849
D: unshared posix mutexes found(38), adding DB_PRIVATE, using fcntl lock
D: opening  db environment /var/lib/rpm/Packages create:cdb:mpool:private
D: opening  db index       /var/lib/rpm/Packages rdonly mode=0x0
D: locked   db index       /var/lib/rpm/Packages
D: opening  db index       /var/lib/rpm/Pubkeys rdonly mode=0x0
error: rpmdbNextIterator: skipping h#     787 Header V3 DSA signature:
BAD, key ID e42d547b
D:  read h#     794 Header sanity check: OK
D: ========== ??? pubkey id 0000000000000000
Segmentation fault (core dumped)


I remove all the package having problem with key ID e42d547b
then rpm --rebuilddb (with and without --nosignature) fails,
the db_dump | dp_verify trick don't work either

> rpm --rebuilddb
error: rpmdbNextIterator: skipping h#     746 blob size(2232): BAD, 8
+ 16 * il(75) + dl(21956)
Segmentation fault (core dumped)

I have no idea what to do next......
Comment 7 Jeff Johnson 2003-12-05 09:07:24 EST
Try renaming /var/lib/rpm/Pubkeys to do --nosignature another
way.

If that "works", then do --rebuilddb -vv to rebuild
the Pubkeys index.

Does that fix?
Comment 8 morgan 2003-12-05 09:20:22 EST
Ok, the problem is fixed !
Thanks a lot for your help !

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