[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: CORRUPT Packages



On Wed, 8 Jan 2003, Jeff Johnson wrote:
> On Wed, Jan 08, 2003 at 04:15:30PM -0700, Rob Brown wrote:
> > I started seeing weird problems when trying to install:
> > 
> > [root@localhost root]# rpm -Uhv package.i386.rpm
> > Segmentation fault
> > [root@localhost root]#
> > 
> > 
> > So I tried some different RPMs.  Then it
> > started hanging forever.  I tried doing
> > rpm --rebuilddb, but that seemed to choke
> > pretty badly too, so I did a strace:
> > 
> > 
> > root     29109  0.0  0.5  6928 1440 pts/6    S    18:59   0:00 /usr/lib/rpm/rpmd --rebuilddb
> > [root@localhost root]# strace -p 29109
> > select(0, NULL, NULL, NULL, {0, 464814}) = 0 (Timeout)
> > select(0, NULL, NULL, NULL, {1, 0})     = 0 (Timeout)
> > select(0, NULL, NULL, NULL, {1, 0})     = 0 (Timeout)
> > select(0, NULL, NULL, NULL, {1, 0})     = 0 (Timeout)
> > select(0, NULL, NULL, NULL, {1, 0})     = 0 (Timeout)
> > 
> 
> This is a stale lock cause by abnormal exit, i.e. segfault.
> 
> Do 
> 	rm -f /var/lib/rpm/__db*

I killed all rpm* pids running from a
"ps fauwwx|grep rpm", then wiped the locks
"rm -f /var/lib/rpm/__db.*", and did
"rpm --rebuild", and it actually finished
after a couple minutes.  Everything is
back to normal.  Whoa!  You're so smart!
That sure beats reformatting the box.
Thank you.  I'm so happy.  :-D

> And please make a report at http://bugzilla.redhat.com with a pointer
> to the corrupt package so that I can get the segfault fixed.
> 
> 73 de Jeff

I tried to duplicate the Seg fault.  But no
luck.  Everything suddenly installs perfectly
now.  I guess I accidently hit CTRL-C in the
middle of an install once while it was dinking
with the database, then I got SEGV after that.
Then everything just started hanging because
the SEGV left those stale locks.  Sorry I
could not be of more help.  I guess rpm doesn't
use atomic commits when making changes to each
file or multiple files.  :-/

FYI: I found a perl module File::Transaction::Atomic
that can do atomic changes to a group of an
unlimited number of files.  It's a bit painful,
but it uses symlinks to accomplish the commit
with a single syscall.  It's a pretty neat
algorithm:

http://search.cpan.org/author/NCLEATON/File-Transaction-Atomic-0.01/Atomic.pm

I don't know how rpm works, but would it help
to steal a couple ideas from that?

--
Rob





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []