This *looks* weird. I did a emerge -e world, to see what fails and what doesn't. Well the emerge of apache "hangs". The build process seems fine, but then it spits out: >>> Completed installing into /usr/src/portage/apache-2.0.50/image/ I decided to strace the emerge process and it is actually running, but possibly is in a loop. I get output like: [blackwidow:marduk/]sudo strace -p 18692 -e stat64 [...] stat64("/usr/src/portage/apache-2.0.50/image/usr/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/mozilla/res/inspector", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 stat64("/usr/src/portage/apache-2.0.50/image/usr/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/mozilla/res/inspector/viewer-registry.rdf", {st_mode=S_IFREG|0664, st_size=3322, ...}) = 0 stat64("/usr/src/portage/apache-2.0.50/image/usr/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/apache2/lib/mozilla/res/inspector/search-registry.rdf", {st_mode=S_IFREG|0664, st_size=377, ...}) = 0 [...] It seems like it's "breaking" out of the apache build directory and going throug my entire /usr/portage (or worse). Could possibly be a bad symlink or something? Reproducible: Always Steps to Reproduce: 1. emerge apache [blackwidow:marduk/]emerge info Portage 2.0.51_pre13 (default-x86-2004.0, gcc-3.3.4, glibc-2.3.4.20040619-r0, 2.6.5-gentoo-r1 i686 AMD Athlon(tm) XP 2700+) ================================================================= System uname: 2.6.5-gentoo-r1 i686 AMD Athlon(tm) XP 2700+ Gentoo Base System version 1.5.1 distcc 2.16 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled] ccache version 2.3 [enabled] Autoconf: sys-devel/autoconf-2.59-r4 Automake: sys-devel/automake-1.8.5-r1 Binutils: sys-devel/binutils-2.14.90.0.8-r1 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CFLAGS="-g -march=athlon-xp -pipe" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control /var/www/localhost/htdocs//mythweb/config" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-g -march=athlon-xp -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache collision-protect distcc nostrip sandbox" GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j6" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage/site /usr/local/portage/gnome-current /usr/local/portage/bmg-overlay" SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage" USE="3dnow X acl alsa avi berkdb cdr crypt cups dvd encode esd evo foomaticdb gdbm gif gnome gstreamer gtk gtk2 imlib java jpeg libg++ mad mmx mozilla mpeg mysql ncurses nls nntp nptl oggvorbis opengl pam pdflib png python quicktime readline sdl slang spell sse ssl tcpd truetype x86 xml xml2 xv zlib"
I think the problem might be the following, though I don't know why: $ /bin/pwd /var/tmp/portage/apache-2.0.50/image/usr/lib/apache2 $ /bin/ls -l drwxr-xr-x 2 root root 280 Jul 20 14:58 build lrwxrwxrwx 1 root root 17 Jul 20 14:58 conf -> /etc/apache2/conf lrwxrwxrwx 1 root root 29 Jul 20 14:58 extramodules -> /usr/lib/apache2-extramodules lrwxrwxrwx 1 root root 8 Jul 20 14:58 lib -> /usr/lib lrwxrwxrwx 1 root root 16 Jul 20 14:58 logs -> /var/log/apache2 drwxr-xr-x 2 root root 1040 Jul 20 14:58 modules $ cd lib/apache2 $ /bin/pwd /usr/lib/apache2 $ /bin/ls -l drwxr-xr-x 2 root root 4096 Jul 2 21:47 build lrwxrwxrwx 1 root root 17 Jul 2 21:47 conf -> /etc/apache2/conf lrwxrwxrwx 1 root root 29 Jul 2 21:47 extramodules -> /usr/lib/apache2-extramodules lrwxrwxrwx 1 root root 8 Jul 2 21:47 lib -> /usr/lib lrwxrwxrwx 1 root root 16 Jul 2 21:47 logs -> /var/log/apache2 drwxr-xr-x 2 root root 4096 Jul 2 21:47 modules $ cd lib/apache2 $ /bin/pwd /usr/lib/apache2 So whatever it's doing, it looks like it's traversing my /usr/lib directory. Perhaps via the apach2/lib link: $ cd /var/tmp/portage/apache-2.0.50/image $ symlinks -vr . relative: /var/tmp/portage/apache-2.0.50/image/usr/lib/libaprutil-0.so -> libaprutil-0.so.0.9.5 relative: /var/tmp/portage/apache-2.0.50/image/usr/lib/libaprutil-0.so.0 -> libaprutil-0.so.0.9.5 other_fs: /var/tmp/portage/apache-2.0.50/image/usr/lib/apache2/conf -> /etc/apache2/conf other_fs: /var/tmp/portage/apache-2.0.50/image/usr/lib/apache2/extramodules -> /usr/lib/apache2-extramodules other_fs: /var/tmp/portage/apache-2.0.50/image/usr/lib/apache2/logs -> /var/log/apache2 other_fs: /var/tmp/portage/apache-2.0.50/image/usr/lib/apache2/lib -> /usr/lib relative: /var/tmp/portage/apache-2.0.50/image/usr/lib/libapr-0.so -> libapr-0.so.0.9.5 relative: /var/tmp/portage/apache-2.0.50/image/usr/lib/libapr-0.so.0 -> libapr-0.so.0.9.5 But shouldn't sandbox have prevented this? Or maybe it's the collision check. Hold on, lemme try it without...
Aha! merging apache with collision-protect turned off works! Still, I've done an 'emerge -e world' (412 pkgs) with portage 2.0.51_pre13 and apache was the only one I had this problem with. So I don't know if it's a portage problem or a problem with the apache ebuild (or both).
The problem is the listdir() function, it hangs at myfilelist = listdir(srcroot, recursive=1, filesonly=1)
Oh, and I think those absolute symlinks are a problem for themselves.
Created attachment 37317 [details, diff] listdir-break-loop.patch This is split from cvs head; it prevents listdir from going infinite for recursive. Please test it.
And... that patch won't work perfectly. ln -s /usr /tmp/dar ln -s /usr /tmp/dar2 echo 'from portage import listdir; print listdir("/tmp",recursive=1);' | python will only fully recurse /tmp/dar, not /tmp/dar2.
*** Bug 67591 has been marked as a duplicate of this bug. ***
*** Bug 67853 has been marked as a duplicate of this bug. ***
We should really get this fixed before 2.0.51 is released if config-protect is to be a publicized feature.
*** Bug 64524 has been marked as a duplicate of this bug. ***
ok, added a new followSymlinks parameter to listdir() that should fix this bug.
Bug has been fixed and released in stable portages on or before 2.0.51-r2