Bug 126634 - rpm --verifydb segfaults
rpm --verifydb segfaults
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
2
i586 Linux
medium Severity high
: ---
: ---
Assigned To: Jeff Johnson
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-06-23 21:11 EDT by Enrique Perez-Terron
Modified: 2007-11-30 17:10 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-06-24 22:58:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
gzip'ed strace of "rpm -vv --verifydb" (4.91 KB, application/octet-stream)
2004-06-23 21:17 EDT, Enrique Perez-Terron
no flags Details
gzip'ed /var/log/dmesg (4.03 KB, application/octet-stream)
2004-06-23 21:31 EDT, Enrique Perez-Terron
no flags Details

  None (edit)
Description Enrique Perez-Terron 2004-06-23 21:11:13 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.6)
Gecko/20040207 Firefox/0.8

Description of problem:
Running rpm --verifydb gives "segmentation fault" within a second or so.



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

How reproducible:
Always

Steps to Reproduce:
1. su - root
2. rpm --verifydb
3.
    

Actual Results:  Segmentation fault

Expected Results:  Some diagnostic message about the rpm db, I don't
know exactly.

Additional info:

Running rpm -vv --verifydb produces:
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/Name rdonly mode=0x0
D: opening  db index       /var/lib/rpm/Basenames rdonly mode=0x0
D: opening  db index       /var/lib/rpm/Group rdonly mode=0x0
D: opening  db index       /var/lib/rpm/Requirename rdonly mode=0x0
D: opening  db index       /var/lib/rpm/Providename rdonly mode=0x0
D: opening  db index       /var/lib/rpm/Conflictname rdonly mode=0x0
D: opening  db index       /var/lib/rpm/Triggername rdonly mode=0x0
D: opening  db index       /var/lib/rpm/Dirnames rdonly mode=0x0
D: opening  db index       /var/lib/rpm/Requireversion rdonly mode=0x0
D: opening  db index       /var/lib/rpm/Provideversion rdonly mode=0x0
D: opening  db index       /var/lib/rpm/Installtid rdonly mode=0x0
D: opening  db index       /var/lib/rpm/Sigmd5 rdonly mode=0x0
D: opening  db index       /var/lib/rpm/Sha1header rdonly mode=0x0
D: opening  db index       /var/lib/rpm/Filemd5s rdonly mode=0x0
D: opening  db index       /var/lib/rpm/Depends create mode=0x0
D: opening  db index       /var/lib/rpm/Pubkeys rdonly mode=0x0
D: closed   db index       /var/lib/rpm/Pubkeys
D: verified db index       /var/lib/rpm/Pubkeys
Segmentation fault
Comment 1 Enrique Perez-Terron 2004-06-23 21:17:46 EDT
Created attachment 101366 [details]
gzip'ed strace of "rpm -vv --verifydb"
Comment 2 Enrique Perez-Terron 2004-06-23 21:31:36 EDT
Created attachment 101367 [details]
gzip'ed /var/log/dmesg

There is nothing directly related to the failure in this file, I just supply it
in case there are questions about what kind of hardware I have, or what exact
version of the Linux kernel I am running.
Comment 3 Jeff Johnson 2004-06-24 05:52:19 EDT
Try /usr/lib/rpm/rpmdb_verify instead:
    cd /var/lib/rpm
    rm -f __db*
    /usr/lib/rpm/rpmdb_verify Packages
is exactly equivalent to --verifydb.

Does that work?
Comment 4 Enrique Perez-Terron 2004-06-24 19:14:50 EDT
Yes, that does work in the sense that the command 

  /usr/lib/rpm/rpmdb_verify Packages

terminates with $? = 0.

There are no __db* in /var/lib/rpm.
Tried rpm --verifydb again after rpmdb_verify, to see if that made a
difference, but I got "Segmentation fault" as before.
Comment 5 Charlie Brady 2004-06-24 21:01:13 EDT
I see exactly the same symptoms. That is:

"sudo rpm --verifydb" segfaults, leaving __db* behind. If I remove
those files in /usr/lib/rpm, and run "sudo /usr/lib/rpm/rpmdb_verify
Packages" it completes successfully, without leaving __db* files. So
"exactly equivalent" is not.

I've an athlon if that matters. Segfault happens here:

mmap2(NULL, 282624, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0xf6802000
open("/var/lib/rpm/Pubkeys", O_RDONLY|O_LARGEFILE) = 18
fcntl64(18, F_SETFD, FD_CLOEXEC)        = 0
_llseek(18, 0, [0], SEEK_SET)           = 0
read(18, "\0\0\0\0\1\0\0\0\0\0\0\0a\25\6\0\10\0\0\0\0\20\0\0\0\10"...,
512) = 512
open("/var/lib/rpm/Pubkeys", O_RDONLY|O_LARGEFILE) = 19
fcntl64(19, F_SETFD, FD_CLOEXEC)        = 0
fstat64(19, {st_mode=S_IFREG|0644, st_size=12288, ...}) = 0
pread(19,
"\0\0\0\0\1\0\0\0\0\0\0\0a\25\6\0\10\0\0\0\0\20\0\0\0\10"..., 4096, 0)
= 4096
pread(19, "\0\0\0\0\1\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\10\0\270\17\0"...,
4096, 4096) = 4096
pread(19,
"\0\0\0\0\1\0\0\0\2\0\0\0\0\0\0\0\0\0\0\0\f\0\214\17\0\2"..., 4096,
8192) = 4096
close(18)                               = 0
close(19)                               = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++


Comment 6 Jeff Johnson 2004-06-24 22:58:36 EDT
rpmdb_verify is a better solution than --verifydb because
it's an external, standalone, utility.

Yup, __db* files must be removed manually after any rpm segfault,
otherwise rpm will block on stale locks.

athlon should not matter.

Any better fix will be removing --verifydb from rpm entirely
in favor of only using rpmdb_verify; i.e. "Don't do that."
Comment 7 Charlie Brady 2004-06-24 23:11:11 EDT
> rpmdb_verify is a better solution than --verifydb because
> it's an external, standalone, utility.

It shouldn't be better is it's "exactly equivalent".

> Any better fix will be removing --verifydb from rpm entirely
> in favor of only using rpmdb_verify;

Wouldn't it be simple to have "rpm --verifydb" being just a wrapper
around "rpmdb_verify"? Then you won't need to change documentation,
retrain folk, or break backwards compatibility. [Just as "rpm -b*"
*could* have been a wrapper around "rpmbuild -b*".]


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