Bug 129932

Summary: rpmbuild works only sometimes but most of the time 'segmentation fault' .. until rebuild of rpm -> works
Product: [Fedora] Fedora Reporter: Dries Verachtert <dries>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED WORKSFORME QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 2CC: nobody+pnasrat
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-17 18:52:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
The full list of installed rpms (rpm -qa output)
none
strace output of rpmbuild when it gets a segmentation fault
none
strace output of rpmbuild when it works
none
buildlog of rpm which i compiled and installed and which works without problems none

Description Dries Verachtert 2004-08-14 17:42:33 UTC
Description of problem:

rpmbuild sometimes works and sometimes doesn't work. For example if i
run the command 'rpmbuild -ba aget.spec' 5 times, then it works 1 or 2
times and the other times i get a 'Segmentation fault'.

If it works, it really works: the rpm and srpm is build and can be
installed.

Distr: fedora core 2
System: the laptop is replaced but i kept the same harddisk.
Originally i had a pentium 4 mobile laptop (dell 8500) but now the
same disk is used in a pentium M laptop (dell 8600). Everything works
(kde, eclipse, mozilla, ..  )
except rpmbuild. I really would like to avoid a reinstall. This laptop
has 2 gig of ram (which was already a problem with the b44 module..
might be important here too).

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

How reproducible:
most of the time but sometimes it works

Steps to Reproduce:
1. rpmbuild -ba <some specfile>

Actual results:
Segmentation fault

Expected results:
normal output, src.rpm and bin rpm

Additional info:
After a rebuild of the source rpm of rpm 4.3.1-0.3 (of fedora core 2),
it works flawlessly.

Comment 1 Dries Verachtert 2004-08-14 17:43:50 UTC
Kernel i use and versions of rpm and glibc:
[dries@delirium ~] uname -a; rpm -q rpm kernel glibc db4
Linux delirium.kotnet.org 2.6.7-1.494.2.2 #1 Tue Aug 3 09:39:58 EDT 2004
i686 i686 i386 GNU/Linux
rpm-4.3.1-0.3
kernel-2.6.5-1.358.8kstacks
kernel-2.6.6-1.427
kernel-2.6.7-1.494.2.2
glibc-2.3.3-27
db4-4.2.52-3.1

Comment 2 Dries Verachtert 2004-08-14 17:45:21 UTC
Created attachment 102730 [details]
The full list of installed rpms  (rpm -qa output)

Comment 3 Dries Verachtert 2004-08-14 17:47:42 UTC
Created attachment 102731 [details]
strace output of rpmbuild when it gets a segmentation fault

Comment 4 Dries Verachtert 2004-08-14 17:48:48 UTC
Created attachment 102732 [details]
strace output of rpmbuild when it works

Comment 5 Dries Verachtert 2004-08-14 17:50:12 UTC
When it crashes, the log ends with the following:

open("/usr/lib/rpm/rpmpopt-4.3.1", O_RDONLY|O_LARGEFILE) = 3
_llseek(3, 0, [22060], SEEK_END)        = 0
_llseek(3, 0, [0], SEEK_SET)            = 0
read(3, "#/*! \\page config_rpmpopt Defaul"..., 22060) = 22060
close(3)                                = 0
open("/etc/popt", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or
directory)
open("/home/dries/.popt", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such
file or directory)
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++


When it doesn't crash, the log contains:


open("/usr/lib/rpm/rpmpopt-4.3.1", O_RDONLY|O_LARGEFILE) = 3
_llseek(3, 0, [22060], SEEK_END)        = 0
_llseek(3, 0, [0], SEEK_SET)            = 0
read(3, "#/*! \\page config_rpmpopt Defaul"..., 22060) = 22060
close(3)                                = 0
open("/etc/popt", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or
directory)
open("/home/dries/.popt", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such
file or directory)
open("/etc/rpm/platform", O_RDONLY|O_LARGEFILE) = 3
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=18, ...}) = 0
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xf6e7f000
select(4, [3], NULL, NULL, {1, 0})      = 1 (in [3], left {1, 0})
gettimeofday({1092392630, 947505}, NULL) = 0
nanosleep({0, 20000000}, {4192176, 4144519720}) = 0
gettimeofday({1092392630, 968678}, NULL) = 0
gettimeofday({1092392630, 968708}, NULL) = 0
nanosleep({0, 20000000}, {92, 0})       = 0
gettimeofday({1092392630, 990619}, NULL) = 0
gettimeofday({1092392630, 990649}, NULL) = 0
nanosleep({0, 20000000}, {86, 0})       = 0
gettimeofday({1092392631, 12594}, NULL) = 0
read(3, "i686-redhat-linux\n", 8192)    = 18
select(4, [3], NULL, NULL, {1, 0})      = 1 (in [3], left {1, 0})
read(3, "", 8174)                       = 0
close(3)                                = 0
munmap(0xf6e7f000, 8192)                = 0
open("/usr/lib/rpm/rpmrc", O_RDONLY|O_LARGEFILE) = 3


As you can see: it crashes just before the line:
open("/etc/rpm/platform", O_RDONLY|O_LARGEFILE) = 3


Comment 6 Dries Verachtert 2004-08-14 17:50:58 UTC
When i use gdb, i get the following backtrace:

[dries@delirium ~/projects/rap-svn/svn/trunk/rpms/aget] gdb rpmbuild
GNU gdb Red Hat Linux (6.0post-0.20040223.19rh)
Copyright 2004 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-gnu"...(no debugging
symbols found)...Using host libthread_db library
"/lib/tls/libthread_db.so.1".

(gdb) set args -ba aget.spec
(gdb) run
Starting program: /usr/bin/rpmbuild -ba aget.spec
Error while mapping shared library sections:
: Success.
Error while reading shared library symbols:
: No such file or directory.
[Thread debugging using libthread_db enabled]
[New Thread -150220128 (LWP 2999)]
Error while reading shared library symbols:
: No such file or directory.
Error while reading shared library symbols:
: No such file or directory.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -150220128 (LWP 2999)]
0x00575910 in ?? ()
(gdb) bt
#0  0x00575910 in ?? ()
#1  0x006bfe02 in rpmPlatform (platform=0x6d515b "/etc/rpm/platform")
at rpmrc.c:791
#2  0x006c02ce in defaultMachine (arch=0xfeed8dc4, os=0xfeed8dc8) at
rpmrc.c:1065
#3  0x006c0989 in rpmSetMachine (arch=0x0, os=0x0) at rpmrc.c:1452
#4  0x006c0d95 in rpmRebuildTargetVars (target=0xfeed8e54,
canontarget=0x0) at rpmrc.c:1551
#5  0x006c1b65 in rpmReadConfigFiles (file=0x6d515b
"/etc/rpm/platform", target=0x0) at rpmrc.c:1820
#6  0x006a7ae6 in rpmcliConfigured () at poptALL.c:135
#7  0x0804aef8 in ?? ()
#8  0x09d0a850 in ?? ()
#9  0x0804bfd9 in _IO_stdin_used ()
#10 0x00000001 in ?? ()
#11 0x0804d420 in ?? ()
#12 0x00000000 in ?? ()
(gdb)

Comment 7 Dries Verachtert 2004-08-14 17:54:35 UTC
As suggested by nasrat on #rpm, i also tried with i386-redhat-linux in
/etc/rpm/platform but the same problem remains.

As suggested by jbj on #rpm, a check of the contents of the file
/etc/rpm/platform:
od -c /etc/rpm/platform
0000000   i   6   8   6   -   r   e   d   h   a   t   -   l   i   n   u
0000020   x  \n
0000022

I also tryed with valgrind as suggested by jbj but i only get
'segmentation fault' as output, but that's probably because i've no
idea how to get valgrind to give me usefull output :-)


Comment 8 Dries Verachtert 2004-08-14 18:01:52 UTC
Created attachment 102735 [details]
buildlog of rpm which i compiled and installed and which works without problems

I've downloaded and installed the source rpm of rpm-4.3.1-0.3. I only changed
the Release in the spec file so rpm -Uvh is easy. After a build, i installed it
and now rpmbuild works without any problems.

Comment 9 Jeff Johnson 2004-10-17 18:52:09 UTC
THis problem appears unique to your machine and so I am going to close.

Please reopen if the problem reappears.