System is a fully updated 6.2, with RPM databases in db3-format. I installed the recently released XFree86-updates using kpackage, and it crashed during installation (SIGABRT, think it was in FileClose or something similar -- unfortunately, I did not keep the call-stack as I didn't know the seriousness of the problem then). After that, the RPM Packages database was broken, and queries does not work anymore. [root@zeus rpm]# rpm -q rpm rpm-4.0.2-6x [root@zeus rpm]# rpm -qa|wc -l memory alloc (612582029 bytes) returned NULL. 106 (the system has some 300-400 packages installed, IIRC). [root@zeus rpm]# db3_verify Packages db_verify: First overflow page 6 has a prev_pgno db_verify: Overflow item incomplete on page 6 db_verify: First overflow page 1082 has a prev_pgno db_verify: Overflow item incomplete on page 1082 db_verify: First overflow page 616 has a prev_pgno db_verify: Overflow item incomplete on page 616 db_verify: Overflow item incomplete on page 2495 db_verify: First overflow page 689 has a prev_pgno db_verify: Overflow item incomplete on page 689 db_verify: First overflow page 210 has a prev_pgno db_verify: Overflow item incomplete on page 210 db_verify: DB->verify: Packages: DB_VERIFY_BAD: Database verification failed (the other database-files are fine) I'll try the current RawHide 4.0.3-version (as noted in other reports), and report back on success/failure.
I'm unable to installed the RawHide-version due to dependencies (bzip2-libs, and the RawHide version required GNU libc v2.2).
You can repair damage in a db3 based rpm database using tools found in the db3-utils package. For example, cd /var/lib/rpm for i in [A-Z]* ; do echo $i -- db3_verify $i done should exhibit the same failure modes. Then you can repair the damage by doing (assuming Packages is damaged) cd /var/lib/rpm mv Package Packages-SAVE db3_dump Packages-SAVE | db3_load Packages and verifying as above.
That did unfortunately not work; the database was repaired, but rpm still crashes: [root@zeus rpm]# mv Packages Packages.corrupted [root@zeus rpm]# db3_dump Packages.corrupted | db3_load Packages [root@zeus rpm]# l total 22784 -rw-r--r-- 1 root root 2637824 Jun 26 14:27 Basenames -rw-r--r-- 1 root root 12288 Apr 27 09:23 Conflictname -rw-r--r-- 1 root root 12288 Jun 26 14:27 Group -rw-r--r-- 1 root root 24576 Jun 26 14:27 Name -rw-r--r-- 1 root root 10407936 Jun 27 11:24 Packages -rw-r--r-- 1 root root 10485760 Jun 26 14:27 Packages.corrupted -rw-r--r-- 1 root root 90112 Jun 26 14:27 Providename -rw-r--r-- 1 root root 94208 Jun 26 14:27 Requirename -rw-r--r-- 1 root root 12288 Jun 26 11:13 Triggername [root@zeus rpm]# db3_verify Packages [root@zeus rpm]# rpm -qa|wc -l memory alloc (612582029 bytes) returned NULL. 106 [root@zeus rpm]# db3_verify Packages [root@zeus rpm]# rpm --rebuilddb memory alloc (612582029 bytes) returned NULL. [root@zeus rpm]# Now I have a non-corrupt database, but the contents are still broken. (This has only happened on one machine, which is very stable; it currently has an uptime of more than 300 days, which was the last powercut here.)
OK, please attach a pointer (i.e. URL) to a tarball of your database cd /var/lib tar czvf /tmp/rpmdb-46025.tar.gz and I'll get you a fix.
Thanks -- I've placed a link to the tarball in the URL field. The Package database is the unrepaired db3-file.
BTW, I've also tried rebuilding the database on a 2GB machine; rpm did not run out of memory there, but it still crashed.
Fixed in rpm-4.0.3-0.55. Meanwhile, your rpm/Packages file and my rebuilddb log are at ftp://people.redhat.com/jbj/rpmdb3-46025-FIX.tar.gz Do the following cd /var/lib/rpm mv Packages Packages-SAVE cd .. tar xzvf rpmdb3-46025-FIX.tar.gz rpm --rebuilddb -vv
Thanks, it works!