Bug 85462 - running rpm produces "Segmentation fault"
running rpm produces "Segmentation fault"
Status: CLOSED WORKSFORME
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
8.0
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-03-02 20:40 EST by Steve Bibayoff
Modified: 2007-04-18 12:51 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-03-15 10:41:34 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Steve Bibayoff 2003-03-02 20:40:26 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901

Description of problem:
When I run rpm with any flags (or even by itself) I get a "Segmentation fault".
No *_db in /var/lib/rpm/ and rpm is not running according to ps auxwwww. rpmdb,
rpmbuild and rpmquery appear to work. Fresh install, never ran rpm before on
this machine. All at cli. No core dump.


If this is a corrupted rpm binary, how would I go about replacing?

Version-Release number of selected component (if applicable): rpm-4.1-1.06
How reproducible:
Always

Steps to Reproduce:
1. run rpm
2.
3.
    

Actual Results:  "Segmentation fault"

Expected Results:  No "Segmentation fault"

Additional info:

don't know if this would be relevant, but here is 'cat /etc/sysconfig/i18n' :
LANG="en_US.UTF-8"
SUPPORTED="en_US.UTF-8:en_US:en:ru_RU.UTF-8:ru_RU:ru:es_MX.UTF-8:es_MX:es"
SYSFONT="latarcyrheb-sun16"
Comment 1 Steve Bibayoff 2003-03-02 21:02:12 EST
Just reliazed a rpmquery appears to work, but it does produce __db.00[1-3] file
in  /var/lib/rpm/. This is from rpmquery only. rpm doesn't produce these files.
And still can't get rpm to work even after I remove the __db.00* files.
Comment 2 Steve Bibayoff 2003-03-04 18:23:21 EST
Output from two different straces with different LANG set (en_US & C) and 'echo
i686-redhat-linux >> /etc/rpm/platform'

LANG=en_US strace rpm --rebuilddb

execve("/bin/rpm", ["rpm", "--rebuild"], [/* 24 vars*/]) = 0
fcntl64(0, F_GETFD)                     = 0
fcntl64(1, F_GETFD)                     = 0
fcntl64(2, F_GETFD)                     = 0
uname({sys="Linux", node="west.DUMMY.com", ...}) = 0
geteuid32()                             = 0
getuid32()                              = 0
getegid32()                             = 0
getgid32()                              = 0
getrlimit(0x3, 0xbffff4c8)              = 0
setrlimit(RLIMIT_STACK, {rlim_cur=2044*1024, rlim_max=RLIM_INFINITY}) = 0
getpid()                                = 3423
rt_sigaction(SIGRTMIN, {0x8141594, [], SA_RESTORER, 0x8161198}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0x8140b20, [], SA_RESTORER, 0x8161198}, NULL, 8) = 0
rt_sigaction(SIGRT_2, {0x8141600, [], SA_RESTORER, 0x8161198}, NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [RTMIN], NULL, 8) = 0
_sysctl({{CTL_KERN, KERN_VERSION}, 2, 0xbffff4d0, 30, (nil), 0}) = 0
brk(0)                                  = 0x8256f38
brk(0x8257f38)                          = 0x8257f38
brk(0x8258000)                          = 0x8258000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=3788320, ...}) = 0
mmap2(NULL, 2097152, PROT_READ, MAP_PRIVATE, 3, 0) =
0x40000000
close(3)                                = 0
open("/usr/lib/rpm/rpmpopt-4.1", O_RDONLY) = 3
lseek(3, 0, SEEK_END)                   = 19318
lseek(3, 0, SEEK_SET)                   = 0
read(3, "#/*! \\page config_rpmpopt Defaul"..., 19318) = 19318
close(3)                                = 0
brk(0x8259000)                          = 0x8259000
brk(0x825a000)                          = 0x825a000
brk(0x825b000)                          = 0x825b000
open("/etc/popt", O_RDONLY)             = -1 ENOENT
(No such file or directory)
getuid32()                              = 0
geteuid32()                             = 0
open("/root/.popt", O_RDONLY)           = -1 ENOENT
(No such file or directory)
open("/usr/share/locale/locale.alias", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=2601, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x40200000
read(3, "# Locale name alias data base.\n#"..., 4096) = 2601
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x40200000, 4096)                = 0
open("/usr/share/locale/en_US/LC_MESSAGES/popt.mo", O_RDONLY) = -1 ENOENT (No
such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/popt.mo", O_RDONLY) = -1 ENOENT (No such
file or directory)
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++

LANG=C strace rpm --rebuilddb

execve("/bin/rpm", ["rpm", "--rebuild"], [/* 24 vars*/]) = 0
fcntl64(0, F_GETFD)                     = 0
fcntl64(1, F_GETFD)                     = 0
fcntl64(2, F_GETFD)                     = 0
uname({sys="Linux", node="west.DUMMY.com", ...}) = 0
geteuid32()                             = 0
getuid32()                              = 0
getegid32()                             = 0
getgid32()                              = 0
getrlimit(0x3, 0xbffff4d8)              = 0
setrlimit(RLIMIT_STACK, {rlim_cur=2044*1024, rlim_max=RLIM_INFINITY}) = 0
getpid()                                = 3435
rt_sigaction(SIGRTMIN, {0x8141594, [], SA_RESTORER, 0x8161198}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0x8140b20, [], SA_RESTORER, 0x8161198}, NULL, 8) = 0
rt_sigaction(SIGRT_2, {0x8141600, [], SA_RESTORER, 0x8161198}, NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [RTMIN], NULL, 8) = 0
_sysctl({{CTL_KERN, KERN_VERSION}, 2, 0xbffff4e0, 30, (nil), 0}) = 0
brk(0)                                  = 0x8256f38
brk(0x8257f38)                          = 0x8257f38
brk(0x8258000)                          = 0x8258000
open("/usr/lib/rpm/rpmpopt-4.1", O_RDONLY) = 3
lseek(3, 0, SEEK_END)                   = 19318
lseek(3, 0, SEEK_SET)                   = 0
read(3, "#/*! \\page config_rpmpopt Defaul"..., 19318) = 19318
close(3)                                = 0
brk(0x8259000)                          = 0x8259000
brk(0x825a000)                          = 0x825a000
open("/etc/popt", O_RDONLY)             = -1 ENOENT
(No such file or directory)
getuid32()                              = 0
geteuid32()                             = 0
open("/root/.popt", O_RDONLY)           = -1 ENOENT
(No such file or directory)
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++ 
Comment 3 Steve Bibayoff 2003-03-04 19:24:50 EST
gdb backtrace output:

[root@west root]# gdb rpm
GNU gdb Red Hat Linux (5.2.1-4)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(no debugging symbols found)...
(gdb) run
Starting program: /bin/rpm 

Program received signal SIGSEGV, Segmentation fault.
0x08168002 in vfprintf ()
(gdb) bt
#0  0x08168002 in vfprintf ()
#1  0x08170d0b in vsprintf ()
#2  0x0816f779 in sprintf ()
#3  0x0807362b in rpmRebuildTargetVars ()
#4  0x0807403f in rpmReadConfigFiles ()
#5  0x0805d28c in rpmcliConfigured ()
#6  0x080485b0 in main ()
#7  0x0815ad62 in __libc_start_main ()
(gdb) 
Comment 4 Steve Bibayoff 2003-03-04 19:57:00 EST
Running gdb again w/ --rpmiodebug arg added:
[root@west root]# gdb rpm
GNU gdb Red Hat Linux (5.2.1-4)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(no debugging symbols found)...
(gdb) set arg  --rpmiodebug 
(gdb) run
Starting program: /bin/rpm --rpmiodebug 

Program received signal SIGSEGV, Segmentation fault.
0x08168002 in vfprintf ()
(gdb) bt
#0  0x08168002 in vfprintf ()
#1  0x08170d0b in vsprintf ()
#2  0x0816f779 in sprintf ()
#3  0x0813d698 in poptGetNextOpt ()
#4  0x08048598 in main ()
#5  0x0815ad62 in __libc_start_main ()
(gdb) 
Comment 5 Jeff Johnson 2003-03-04 20:01:19 EST
What was on stderr? That should have a message for each file opened.
Comment 6 JP Fielding 2003-03-06 15:45:17 EST
I have the same problem.  Not sure if it's the same cause, but the symptoms
exactly the same. 

Having retraced my steps of what i've recently done, I managed to reproduce on
another box.

Steps to reproduce:
1)  use up2date (get everything up to date) (probably not necessary)
2)  install newer verion of glibc-2.3.1-46 (with dependent
binutils-2.13.90.0.18-6 & memprof-0.5.1-3
3)  run 'rpm -<anything>', watch segmentation fault
Comment 7 Jeff Johnson 2003-03-14 16:47:30 EST
JPFielding: could you open seperate bug please? thanks.

smb32: do you have fix? otherwise i'm waiting for data ...
Comment 8 Steve Bibayoff 2003-03-14 18:12:38 EST
Don't know what you mean from "What was on stderr? That should have a message
for each file opened."? Doen't strace show what files where opened?

Comment 9 Jeff Johnson 2003-03-14 18:33:21 EST
Ah, sorry for the confusion. With --rpmiodebug, each
and every I/O operation prints a message.

Well, you're dying before doing almost anything in
rpm, and that's what has me stumped.

However, did you upgrade popt when you upgraded
rpm? An old libpopt.so.0 would explain a lot ...
Comment 10 Steve Bibayoff 2003-03-14 18:56:00 EST
This was a semi-fresh install have rh 8.0 . All I kept was the /home directory.
I haven't had a chance yet to upgrade rpm. I be using the rpm2cpio trick you
emailed me to upgrade to rpm-4.1-9 . The current version according to rpmquery
is 4.1-1.06 . rpmquery report popt to be version 1.7-1.06 .

A 'rpm --rpmiodebug' just produces a "Segmentation fault".

 
Comment 11 Jeff Johnson 2003-03-15 10:41:34 EST
Bingo. Upgrade to the popt with rpm-4.1-9 using the
same rpm2cpio.sh script.

FYI, you might want to try rpm-4.1.1-0.3.8x from
    ftp://ftp.rpm.org/pub/rpm/test-4.1.1
That's gonna be an errata for 8.0 soon.

Reopen if you still have problems.

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