LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   RPM command is not working (Segmentation fault) (https://www.linuxquestions.org/questions/linux-newbie-8/rpm-command-is-not-working-segmentation-fault-622717/)

josinjosek 02-21-2008 04:20 AM

RPM command is not working (Segmentation fault)
 
In one of my linux box rpm command is not working.i am getting "Segmentation fault " error and i found inside /var/lib/rpm dir
__db.001 ,__db.002,__db.003 these files are missing can you please help me to resolve this issue.

#locate rpm | grep bin
/bin/rpm
/usr/bin/rpmgraph
/usr/bin/rpmbuild
/usr/bin/rpm2cpio
/usr/bin/rpmquery
/usr/bin/rpmdb
/usr/bin/rpmverify
/usr/bin/pamsharpmap
/usr/bin/rpmsign

unSpawn 02-21-2008 12:46 PM

Since when isn't it working? What happened at that time? (check logs?) Which files are missing exactly? Can you boot your distro's installer CD in recue mode to check with 'rpm -qVa'?

josinjosek 02-21-2008 11:33 PM

hi unSpawn,
Thanks for your replay.
Issue is resolved, we have copied the (__db.001 ,__db.002,__db.003 files ) from usr/lib/rpmdb/x86_64-redhat-linux/redhat to /var/lib/rpm and reloaded the rpm database. Now the rpm command is working fine. Thanks a lot..

madyogi 05-11-2009 10:57 AM

rpm & segmentation fault again...
 
Hello.
I have a very same problem.

I'm updating software on my old post RH9 Linux server. Everything is 99.9% done from sources...
Did plenty of updates including kernel (2.6.27.x), glibc (2.4), gcc, binutils (2.18), gtk2+, openssl, automake & autoconf, and plenty, plenty of others... This all is done on a live 'body' so I have to be careful.

Old rpm package (4.2) stopped working after glibc update (I really don't want to go back to the old one).
The entire system is stable and everything else seems to work fine, it reboots, mounts drives, plays CDs, even starts X window with old 3.4 KDE, all services are working well.

Lately decided to update the RPM package to the latest 4.7.0 ver.
I have a copy of the old rpm database in safe place so I can do anything with /var/lib/rpm/*
Also saved the /var/log/rpmpkgs.

Before compiling RPM itself I had to update/install following:

- NSS & NSPR libraries (Mozilla),
- Berkeley db-4.5.20 (also required for latest sendmail releases),
- LUA language library,

Well, after doing:
]$ cd rpm-4.7.0 (source)
]$ ./configure --prefix=/usr --with-external-db --with-lua=/usr/local CPPFLAGS="-I/usr/include/nspr -I/usr/include/nss/nss -I/usr/include/nss/dbm"
]$ make // everything went fine here
]$ make check // 72 tests but plenty of them failed :(

You can download the logfile, a result of 'make check' procedure here:
http://www.ptatera.pl/download/rpmtests.log

Finally I did:
]$ make install
]$ mkdir /var/lib/rpm
]$ chown rpm.rpm /var/lib/rpm
]$ rpm --initdb
And it throws out "Segmentation fault"
then:
]$ tail /var/log/messages
gives:
May 11 17:02:19 seawolf kernel: rpm[6168]: segfault at 0 ip 00000000 sp bfeacdfc error 4 in rpm[8048000+4000]

Exactly the same way the rpm-4.6 dist. works... (or rather isn't working).

Could anyone help please?
Regards.

P.S.
And yes, I've moved from i386 to i686 arch...

madyogi 05-12-2009 06:13 AM

OK. Downloaded latest stable release of gcc-4.4.0 and now the rpm source doesn't build at all. It throws out plenty of errors. Starting like:
Code:

gcc -shared  .libs/argv.o .libs/base64.o .libs/digest.o .libs/fts.o .libs/macro.o .libs/rpmhook.o .libs/rpmio.o .libs/rpmlog.o .libs/rpmlua.o .libs/rpmmalloc.o .libs/rpmpgp.o .libs/rpmsq.o .libs/rpmsw.o .libs/url.o .libs/rpmstring.o .libs/rpmfileutil.o .libs/rpmkeyring.o -Wl,--whole-archive ../misc/.libs/libmisc.a -Wl,--no-whole-archive  -lnss3 -lbz2 -lz /usr/lib/libpopt.so -lrt -lpthread  -Wl,-soname -Wl,librpmio.so.0 -o .libs/librpmio.so.0.0.0
.libs/base64.o: In function `__cmsg_nxthdr':
/usr/include/bits/socket.h:265: multiple definition of `__cmsg_nxthdr'
.libs/argv.o:/usr/include/bits/socket.h:265: first defined here

Any suggestions?


All times are GMT -5. The time now is 07:08 PM.