Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 57598 - Collision-protection causing infinate loop
Summary: Collision-protection causing infinate loop
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
: 64524 67591 67853 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-07-19 08:40 UTC by Albert Hopkins (RETIRED)
Modified: 2004-10-22 08:48 UTC (History)
4 users (show)

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


Attachments
listdir-break-loop.patch (listdir-fix.patch,971 bytes, patch)
2004-08-12 16:00 UTC, Brian Harring (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Albert Hopkins (RETIRED) gentoo-dev 2004-07-19 08:40:32 UTC
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"
Comment 1 Albert Hopkins (RETIRED) gentoo-dev 2004-07-20 13:41:24 UTC
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...
Comment 2 Albert Hopkins (RETIRED) gentoo-dev 2004-07-20 13:50:43 UTC
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).

Comment 3 Marius Mauch (RETIRED) gentoo-dev 2004-08-01 00:54:13 UTC
The problem is the listdir() function, it hangs at
    myfilelist = listdir(srcroot, recursive=1, filesonly=1)
Comment 4 Marius Mauch (RETIRED) gentoo-dev 2004-08-01 01:15:37 UTC
Oh, and I think those absolute symlinks are a problem for themselves.
Comment 5 Brian Harring (RETIRED) gentoo-dev 2004-08-12 16:00:00 UTC
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.
Comment 6 Brian Harring (RETIRED) gentoo-dev 2004-08-15 21:25:11 UTC
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.
Comment 7 Mike Nerone 2004-10-14 15:40:36 UTC
*** Bug 67591 has been marked as a duplicate of this bug. ***
Comment 8 Jason Stubbs (RETIRED) gentoo-dev 2004-10-17 02:37:55 UTC
*** Bug 67853 has been marked as a duplicate of this bug. ***
Comment 9 Jason Stubbs (RETIRED) gentoo-dev 2004-10-17 02:39:12 UTC
We should really get this fixed before 2.0.51 is released if config-protect is to be a publicized feature.
Comment 10 Marius Mauch (RETIRED) gentoo-dev 2004-10-17 08:32:04 UTC
*** Bug 64524 has been marked as a duplicate of this bug. ***
Comment 11 Marius Mauch (RETIRED) gentoo-dev 2004-10-17 08:41:46 UTC
ok, added a new followSymlinks parameter to listdir() that should fix this bug.
Comment 12 Nicholas Jones (RETIRED) gentoo-dev 2004-10-22 08:48:02 UTC
Bug has been fixed and released in stable portages on or before 2.0.51-r2