Red Hat Bugzilla – Bug 106954
rpm crashes with EINVAL errors
Last modified: 2007-04-18 12:58:21 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624
Description of problem:
As soon as I try to do anything with rpm, it exits with the following errors,
and I have to remove the lock files manually.
rpmdb: write: 0xbfffc4d0, 8192: Invalid argument
error: db4 error(22) from dbenv->open: Invalid argument
error: cannot open Packages index using db3 - Invalid argument (22)
error: cannot open Packages database in /var/lib/rpm
An strace revealed that only a write syscall actually returned EINVAL, so I'm
guessing that the other errors stem from the first. What the write call tries to
do is write 8192 NUL chars to the lock file, using a buffer that is prefilled
with NULs. strace can reveal the beginning of the buffer, so it seems that the
error is that the buffer is too short rather than rpm passes a completely
invalid address to the write call.
I didn't actually notice this problem until I upgraded to the 2.6.0-test4 kernel
(was running a 2.4.21 with ACL patches before), but on the other hand I hadn't
used rpm for a while before that, so I don't know if it is directly related to it.
On my RH8 system with RPM 4.1 it works with 2.6.0-test4, and on my RH7.1 system
(running RPM 4.0.2) on which I upgraded the kernel to 2.6.0-test6, it also
works, so it seems to be limited to RPM 4.2.
Version-Release number of selected component (if applicable):
I can't get the exact version since RPM isn't working. It's the stock RH9 4.2
Steps to Reproduce:
Run rpm with any command that makes use of the database.
You have the O_DIRECT problem, fixeed in rpm-4.2.1
packages at ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.2.x
Blame Linus, not me.
Hmmm, fixed in rpm-4.2 packages, not rpm-4.2.1. Apologies for the typo.