Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 158226 - ebuild foo.ebuild rpm fails
Summary: ebuild foo.ebuild rpm fails
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-15 08:51 UTC by Nick Pollitt
Modified: 2007-10-04 23:07 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ebuild debug output (ebuild.rpm.out,63.87 KB, text/plain)
2006-12-15 08:55 UTC, Nick Pollitt
Details
Portage spec file (portage-2.1.1-r2.spec,500 bytes, text/plain)
2006-12-15 08:59 UTC, Nick Pollitt
Details
Portage output log (rpmfail,19.02 KB, text/plain)
2007-01-17 00:05 UTC, Nick Pollitt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Pollitt 2006-12-15 08:51:31 UTC
proclus ~ # emerge --info
Portage 2.1.1-r2 (default-linux/x86/2006.1, gcc-4.1.1, glibc-2.4-r4, 2.6.17.13 i686)
=================================================================
System uname: 2.6.17.13 i686 Intel(R) Pentium(R) 4 CPU 2.80GHz
Gentoo Base System version 1.12.6
Last Sync: Fri, 15 Dec 2006 04:30:01 +0000
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: 1.3.7, 2.0.30
dev-lang/python:     2.3.5-r3, 2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O3 -march=pentium4 -msse -msse2 -mmmx "
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/lib/mozilla/defaults/pref /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/init.d /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-O3 -march=pentium4 -msse -msse2 -mmmx "
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig cvs distlocks metadata-transfer parallel-fetch sandbox sfperms strict test"
GENTOO_MIRRORS="ftp://gentoo.cites.uiuc.edu/pub/gentoo/ http://gentoo.inf.elte.hu/ http://darkstar.ist.utl.pt/gentoo/ ftp://ftp.linux.ee/pub/gentoo/distfiles/ ftp://darkstar.ist.utl.pt/pub/gentoo/ http://ftp.isu.edu.tw/pub/Linux/Gentoo"
LINGUAS="en en_GB en_US"
MAKEOPTS=""
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 # X aac aalib acl acpi aim akode alsa alsa_cards_intel8x0 apache2 apm arts asf audiofile avi bash-completion berkdb bitmap-fonts browserplugin bzip2 bzlib cairo calendar canna cdparanoia cdr cli cpudetection cracklib crypt cscope cups curl custom-cflags d5sum dga dio directfb divx4linux dlloader dmx dri dv dvd dvdr dvdread elibc_glibc encode ethereal extensions fbcon ffmpeg firefox flac flash font-server foomaticdb fortran ftp gcj gd gdbm ggi gif gmp gnutls gphoto2 gpm gps gs gtk hal i8x0 iconv ieee1394 imagemagick imap imlib innodb input_devices_evdev input_devices_keyboard input_devices_mouse iptables ipv6 isdnlog java jbig jpeg jpeg2k kde kdeenablefinal kdepim kernel_linux lcms ldap libg++ linguas_en linguas_en_GB linguas_en_US logitech-mouse mad md5sum mikmod ming mjpeg mmap mmx mng modplug mp3 mpeg mplayer mysql ncurses nis nls nodrm nptl nptlonly nsplugin ogg on-the-fly-crypt opengl option pam pcre pda pdf perl php png posix povray ppds pppd python qt4 quicktime readline real reflection rtc samba sdl session slp snmp spell spl sse sse2 ssl ssmtp swat sysfs syslog tcl tcpd theora threads tiff tk truetype truetype-fonts type1-fonts udev unicode usb userland_GNU v4l v4l2 vcd video_cards_i810 video_cards_i865 video_cards_v4l video_cards_vmware vidix vim vim-with-x vorbis wifi win32codecs wmf xine xinerama xml xorg xv xvid xvmc zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY


I tried to create an RPM for portage-2.1.1-r2 using 'ebuild portage-2.1.1-r2.ebuild rpm' but it failed.  The debug output will be attached, since it's too large to post here.

I also tried to produce an RPM for sci-calculators/units-1.80-r1 and that too failed.
Comment 1 Nick Pollitt 2006-12-15 08:55:26 UTC
Created attachment 104092 [details]
ebuild debug output

It looks like the problem is happening here:
+ diefunc dyn_rpm 410 139 'Failed to integrate rpm spec file'
Comment 2 Nick Pollitt 2006-12-15 08:59:28 UTC
Created attachment 104093 [details]
Portage spec file

This is the ebuild-generated spec file from /var/tmp/portage.
Comment 3 Nick Pollitt 2006-12-15 09:00:15 UTC
It looks like /var/tmp/rpm-tmp.69061 was cleaned up, so I can't attach that.
Comment 4 Marius Mauch (RETIRED) gentoo-dev 2007-01-11 07:07:07 UTC
The error is caused by rpmbuild segfaulting:

Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.69061
+ umask 022
+ cd /usr/src/rpm/BUILD
+ cd portage-2.1.1
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip
+ /usr/lib/rpm/brp-strip-static-archive
+ /usr/lib/rpm/brp-strip-comment-note
+ /usr/lib/rpm/brp-nobuildrootpath
Processing files: portage-2.1.1-r2
/usr/lib/portage/bin/misc-functions.sh: line 406: 28400 Segmentation fault      rpmbuild -bb "${PF}.spec"
Comment 5 Sandro Bonazzola (RETIRED) gentoo-dev 2007-01-11 18:19:04 UTC
I'll see what I can do for this. However I haven't a pentium4 for reproducing the same behaviour with your CFLAGS, so I'll need you for actual testing when I've something to test.
Comment 6 Nick Pollitt 2007-01-12 00:27:51 UTC
I just upgraded gcc and rebuilt rpm, still looks like the same problem.
gcc version 4.1.1 (Gentoo 4.1.1-r3)

Processing files: portage-2.1.1-r2
/usr/lib/portage/bin/misc-functions.sh: line 406:  3985 Segmentation fault      rpmbuild -bb "${PF}.spec"
Comment 7 Sandro Bonazzola (RETIRED) gentoo-dev 2007-01-16 22:14:00 UTC
Please unmask =app-arch/rpm-4.4.7-r2 and test it on your system.
Comment 8 Nick Pollitt 2007-01-17 00:05:04 UTC
Created attachment 107226 [details]
Portage output log

Feature request - get 'ebuild foo.ebuild rpm' to use my .rpmrc file.  The /usr/src/[rpm|redhat|gentoo] thing is annoying.

New RPM fails, output in the attachment.
Comment 9 Sandro Bonazzola (RETIRED) gentoo-dev 2007-01-24 12:23:55 UTC
Can you provide a backtrace? See http://www.gentoo.org/proj/en/qa/backtraces.xml if you need some help for this.
Comment 10 Nick Pollitt 2007-01-25 19:42:42 UTC
One failure comes from here:
error: cannot write to %_sourcedir /usr/src/gentoo/SOURCES

Why is it looking in /usr/src/gentoo???  Will remove that and symlink to redhat.
Comment 11 Nick Pollitt 2007-01-25 19:46:10 UTC
RPM was rebuilt with: 
ACCEPT_KEYWORDS="~x86" FEATURES="nostrip" USE="debug" CFLAGS="-O1 -march=pentium4 -g -ggdb" emerge -v =app-arch/rpm-4.4.7-r2

ebuild portage-2.1.1-r2.ebuild rpm:
<snip>
gzipping man page: portage.5
strip: i686-pc-linux-gnu-strip --strip-unneeded
   usr/lib/portage/bin/tbz2tool
tar: Removing leading `/' from member names
*** glibc detected *** rpmbuild: free(): invalid pointer: 0xb7f9d0ca ***
======= Backtrace: =========
/lib/libc.so.6[0xb7b5419b]
/lib/libc.so.6(__libc_free+0x79)[0xb7b556ea]
/usr/lib/librpmbuild-4.4.so[0xb7f928d9]
/usr/lib/librpmbuild-4.4.so(parsePrep+0xa2e)[0xb7f93728]
/usr/lib/librpmbuild-4.4.so(parseSpec+0x234)[0xb7f959c4]
rpmbuild[0x804a44c]
rpmbuild[0x804a6c1]
rpmbuild[0x804b343]
/lib/libc.so.6(__libc_start_main+0xdc)[0xb7b08864]
rpmbuild[0x8049b01]
======= Memory map: ========
08048000-0804c000 r-xp 00000000 03:02 75774502   /usr/lib/rpm/rpmb
0804c000-0804d000 rw-p 00003000 03:02 75774502   /usr/lib/rpm/rpmb
0804d000-08115000 rw-p 0804d000 00:00 0          [heap]
b7800000-b7821000 rw-p b7800000 00:00 0
b7821000-b7900000 ---p b7821000 00:00 0
b79e9000-b79eb000 rw-p b79e9000 00:00 0
b79eb000-b79f4000 r-xp 00000000 03:02 49906087   /usr/lib/gcc-lib/i686-pc-linux-gnu/4.1.1/libgcc_s.so.1
b79f4000-b79f5000 rw-p 00008000 03:02 49906087   /usr/lib/gcc-lib/i686-pc-linux-gnu/4.1.1/libgcc_s.so.1
b79f5000-b7a17000 r-xp 00000000 03:02 117939902  /lib/libm-2.4.so
b7a17000-b7a19000 rw-p 00021000 03:02 117939902  /lib/libm-2.4.so
b7a19000-b7a1a000 rw-p b7a19000 00:00 0
b7a1a000-b7ae8000 r-xp 00000000 03:02 49906089   /usr/lib/gcc-lib/i686-pc-linux-gnu/4.1.1/libstdc++.so.6.0.8
b7ae8000-b7aeb000 r--p 000ce000 03:02 49906089   /usr/lib/gcc-lib/i686-pc-linux-gnu/4.1.1/libstdc++.so.6.0.8
b7aeb000-b7aed000 rw-p 000d1000 03:02 49906089   /usr/lib/gcc-lib/i686-pc-linux-gnu/4.1.1/libstdc++.so.6.0.8
b7aed000-b7af3000 rw-p b7aed000 00:00 0
b7af3000-b7c03000 r-xp 00000000 03:02 117939934  /lib/libc-2.4.so
b7c03000-b7c05000 r--p 0010f000 03:02 117939934  /lib/libc-2.4.so
b7c05000-b7c07000 rw-p 00111000 03:02 117939934  /lib/libc-2.4.so
b7c07000-b7c0a000 rw-p b7c07000 00:00 0
b7c0a000-b7c19000 r-xp 00000000 03:02 117456930  /lib/libbz2.so.1.0.3
b7c19000-b7c1a000 rw-p 0000f000 03:02 117456930  /lib/libbz2.so.1.0.3
b7c1a000-b7c2d000 r-xp 00000000 03:02 71339752   /lib/libz.so.1.2.3
b7c2d000-b7c2e000 rw-p 00012000 03:02 71339752   /lib/libz.so.1.2.3
b7c2e000-b7c35000 r-xp 00000000 03:02 117939914  /lib/librt-2.4.so
b7c35000-b7c37000 rw-p 00006000 03:02 117939914  /lib/librt-2.4.so
b7c37000-b7c38000 rw-p b7c37000 00:00 0
b7c38000-b7c40000 r-xp 00000000 03:02 77804952   /usr/lib/libpopt.so.0.0.0
b7c40000-b7c41000 rw-p 00007000 03:02 77804952   /usr/lib/libpopt.so.0.0.0
b7c41000-b7c4f000 r-xp 00000000 03:02 117939909  /lib/libresolv-2.4.so
b7c4f000-b7c51000 rw-p 0000d000 03:02 117939909  /lib/libresolv-2.4.so
b7c51000-b7c53000 rw-p b7c51000 00:00 0
b7c53000-b7c62000 r-xp 00000000 03:02 117939908  /lib/libpthread-2.4.so
b7c62000-b7c63000 r--p 0000e000 03:02 117939908  /lib/libpthread-2.4.so
b7c63000-b7c64000 rw-p 0000f000 03:02 117939908  /lib/libpthread-2.4.so
b7c64000-b7c66000 rw-p b7c64000 00:00 0
b7c66000-b7c77000 r-xp 00000000 03:02 75658743   /usr/lib/libmagic.so.1.0.0
b7c77000-b7c78000 rw-p 00010000 03:02 75658743   /usr/lib/libmagic.so.1.0.0
b7c78000-b7c9f000 r-xp 00000000 03:02 29640569   /usr/lib/libexpat.so.0.5.0
b7c9f000-b7ca1000 rw-p 00026000 03:02 29640569   /usr/lib/libexpat.so.0.5.0
b7ca1000-b7ca3000 r-xp 00000000 03:02 117939904  /lib/libdl-2.4.so
b7ca3000-b7ca5000 rw-p 00001000 03:02 117939904  /lib/libdl-2.4.so
b7ca5000-b7ca6000 rw-p b7ca5000 00:00 0
b7ca6000-b7dc3000 r-xp 00000000 03:02 41999735   /usr/lib/libcrypto.so.0.9.8
b7dc3000-b7dd8000 rw-p 0011c000 03:02 41999735   /usr/lib/libcrypto.so.0.9.8
b7dd8000-b7ddb000 rw-p b7dd8000 00:00 0
b7ddb000-b7e15000 r-xp 00000000 03:02 41999744   /usr/lib/libssl.so.0.9.8
b7e15000-b7e19000 rw-p 00039000 03:02 41999744   /usr/lib/libssl.so.0.9.8
b7e19000-b7e35000 r-xp 00000000 03:02 4252790    /usr/lib/libneon.so.26.0.1
b7e35000-b7e36000 rw-p 0001c000 03:02 4252790    /usr/lib/libneon.so.26.0.1
b7e36000-b7e65000 r-xp 00000000 03:02 38009668   /usr/lib/libbeecrypt.so.6.4.0
b7e65000-b7e68000 rw-p 0002f000 03:02 38009668   /usr/lib/libbeecrypt.so.6.4.0
b7e68000-b7e79000 r-xp 00000000 03:02 121772686  /usr/lib/libelf-0.118.so
b7e79000-b7e7a000 rw-p 00010000 03:02 121772686  /usr/lib/libelf-0.118.so
b7e7a000-b7eab000 r-xp 00000000 03:02 64256899   /usr/lib/librpmio-4.4.so
b7eab000-b7ead000 rw-p 00030000 03:02 64256899   /usr/lib/librpmio-4.4.so
b7ead000-b7ed1000 rw-p b7ead000 00:00 0
b7ed1000-b7ee8000 r-xp 00000000 03:02 64256903   /usr/lib/librpmdb-4.4.so
b7ee8000-b7eea000 rw-p 00017000 03:02 64256903   /usr/lib/librpmdb-4.4.so
b7eea000-b7f48000 r-xp 00000000 03:02 64256908   /usr/lib/librpm-4.4.so
b7f48000-b7f4d000 rw-p 0005d000 03:02 64256908   /usr/lib/librpm-4.4.so
b7f4d000-b7f7f000 rw-p b7f4d000 00:00 0
b7f7f000-b7fa0000 r-xp 00000000 03:02 64256912   /usr/lib/librpmbuild-4.4.so
b7fa0000-b7fa2000 rw-p 00021000 03:02 64256912   /usr/lib/librpmbuild-4.4.so
b7fa2000-b7fae000 rw-p b7fa2000 00:00 0
b7fc9000-b7fd1000 r-xp 00000000 03:02 117939913  /lib/libnss_files-2.4.so
b7fd1000-b7fd3000 rw-p 00007000 03:02 117939913  /lib/libnss_files-2.4.so
b7fd3000-b7fd5000 rw-p b7fd3000 00:00 0
b7fd5000-b7fdc000 r-xp 00000000 03:02 37980206   /usr/lib/libsandbox.so.0.0.0
b7fdc000-b7fdd000 rw-p 00006000 03:02 37980206   /usr/lib/libsandbox.so.0.0.0
b7fdd000-b7fe0000 rw-p b7fdd000 00:00 0
b7fe0000-b7ff9000 r-xp 00000000 03:02 117940044  /lib/ld-2.4.so
b7ff9000-b7ffa000 r--p 00019000 03:02 117940044  /lib/ld-2.4.so
b7ffa000-b7ffb000 rw-p 0001a000 03:02 117940044  /lib/ld-2.4.so
bfc2f000-bfc5d000 rw-p bfc2f000 00:00 0          [stack]
ffffe000-fffff000 ---p 00000000 00:00 0          [vdso]
/usr/lib/portage/bin/misc-functions.sh: line 406: 19894 Aborted                 (core dumped) rpmbuild -bb "${PF}.spec"

!!! ERROR: sys-apps/portage-2.1.1-r2 failed.
Call stack:
  misc-functions.sh, line 417:   Called dyn_rpm
  misc-functions.sh, line 410:   Called die

!!! Failed to integrate rpm spec file
!!! If you need support, post the topmost build error, and the call stack if relevant.
Comment 12 Nick Pollitt 2007-01-25 19:47:59 UTC
gdb /usr/bin/rpmbuild /var/tmp/portage/core.19894

<snip>
(gdb) bt
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb7b1b209 in raise () from /lib/libc.so.6
#2  0xb7b1c633 in abort () from /lib/libc.so.6
#3  0xb7b4ee0c in __fsetlocking () from /lib/libc.so.6
#4  0xb7b5419b in malloc_usable_size () from /lib/libc.so.6
#5  0xb7b556ea in free () from /lib/libc.so.6
#6  0xb7f928d9 in doUntar (spec=0x80e02d8, c=<value optimized out>, quietly=0)
    at rpmlib.h:66
#7  0xb7f93728 in parsePrep (spec=0x80e02d8, verify=1) at parsePrep.c:413
#8  0xb7f959c4 in parseSpec (ts=0x80e0068,
    specFile=0xbfc53d30 "/var/tmp/portage/portage-2.1.1-r2.spec",
    rootURL=0xb7f4498c "/", recursing=0, passPhrase=0x804b8dd "", cookie=0x0,
    anyarch=0, force=0, verify=1) at parseSpec.c:484
#9  0x0804a44c in buildForTarget (ts=0x80e0068,
    arg=0xbfc597ba "portage-2.1.1-r2.spec", ba=0xb7fade60) at build.c:255
#10 0x0804a6c1 in build (ts=0x80e0068, arg=0xbfc597ba "portage-2.1.1-r2.spec",
    ba=0xb7fade60, rcfile=0x0) at build.c:312
#11 0x0804b343 in main (argc=3, argv=Cannot access memory at address 0x4dba
) at rpmqv.c:679
(gdb)
Comment 13 Nick Pollitt 2007-02-09 20:26:09 UTC
Was the back-trace info I provided sufficient for your debugging needs?
Comment 14 Sandro Bonazzola (RETIRED) gentoo-dev 2007-02-12 19:54:05 UTC
(In reply to comment #10)
> One failure comes from here:
> error: cannot write to %_sourcedir /usr/src/gentoo/SOURCES
> 
> Why is it looking in /usr/src/gentoo???  Will remove that and symlink to
> redhat.

Because rpm is on a gentoo system, not on a redhat system :-).
Mmm maybe it's better add a warning about this.
Comment 15 Sandro Bonazzola (RETIRED) gentoo-dev 2007-02-12 20:00:01 UTC
(In reply to comment #13)
> Was the back-trace info I provided sufficient for your debugging needs?
> 

I'm waiting for upstream comment to this back-trace.
Comment 16 Nick Pollitt 2007-05-02 02:05:16 UTC
Using rpm 4.4.6-r4 I was able to produce an rpm for portage 2.1.2.2-r0.

RPM was built using:
ACCEPT_KEYWORDS="~x86" FEATURES="keepwork nostrip -test" USE="debug" CFLAGS="-O1 -march=pentium4 -g -ggdb" emerge -v rpm
Comment 17 Jakub Moc (RETIRED) gentoo-dev 2007-10-04 23:07:14 UTC
(In reply to comment #16)
> Using rpm 4.4.6-r4 I was able to produce an rpm for portage 2.1.2.2-r0.

Well, closing then.