Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 71093 - env-update broken: "IndexError: string index out of range"
Summary: env-update broken: "IndexError: string index out of range"
Status: RESOLVED WORKSFORME
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: x86 Linux
: High critical (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-13 14:49 UTC by Brian Toovey
Modified: 2005-02-28 09:21 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Toovey 2004-11-13 14:49:14 UTC
portage is failing on all emerge - example for bash:

>>> Merging app-shells/bash-2.05b-r9 to /
--- /usr/
--- /usr/bin/
>>> /usr/bin/bashbug
--- /usr/share/
--- /usr/share/man/
--- /usr/share/man/man1/
>>> /usr/share/man/man1/rbash.1.gz
>>> /usr/share/man/man1/bash.1.gz
>>> /usr/share/man/man1/bashbug.1.gz
>>> /usr/share/man/man1/builtins.1.gz
--- /usr/share/info/
>>> /usr/share/info/bashref.info.gz -> bash.info.gz
>>> /usr/share/info/bash.info.gz
--- /usr/share/doc/
>>> /usr/share/doc/bash-2.05b-r9/
>>> /usr/share/doc/bash-2.05b-r9/README.gz
>>> /usr/share/doc/bash-2.05b-r9/NEWS.gz
>>> /usr/share/doc/bash-2.05b-r9/AUTHORS.gz
>>> /usr/share/doc/bash-2.05b-r9/CHANGES.gz
>>> /usr/share/doc/bash-2.05b-r9/COMPAT.gz
>>> /usr/share/doc/bash-2.05b-r9/Y2K.gz
>>> /usr/share/doc/bash-2.05b-r9/FAQ.gz
>>> /usr/share/doc/bash-2.05b-r9/INTRO.gz
--- /bin/
>>> /bin/bash
>>> /bin/sh -> bash
>>> /bin/rbash -> bash
Traceback (most recent call last):
  File "/usr/bin/emerge", line 2991, in ?
    mydepgraph.merge(mydepgraph.altlist())
  File "/usr/bin/emerge", line 1839, in merge
    retval=portage.doebuild(y,"merge",myroot,self.pkgsettings,edebug)
  File "/usr/lib/portage/pym/portage.py", line 2562, in doebuild
    return merge(mysettings["CATEGORY"],mysettings["PF"],mysettings["D"],mysettings["BUILDDIR"]+"/build-info",myroot,mysettings,myebuild=mysettings["EBUILD"])
  File "/usr/lib/portage/pym/portage.py", line 2695, in merge
    return mylink.merge(pkgloc,infloc,myroot,myebuild)
  File "/usr/lib/portage/pym/portage.py", line 6670, in merge
    return self.treewalk(mergeroot,myroot,inforoot,myebuild,cleanup=cleanup)
  File "/usr/lib/portage/pym/portage.py", line 6385, in treewalk
    env_update(makelinks=(not downgrade))
  File "/usr/lib/portage/pym/portage.py", line 599, in env_update
    if y[-1]!='/':
IndexError: string index out of range

Reproducible: Always
Steps to Reproduce:
1. Might have started after prelinking - not sure though
2. emerge anything
3. fails on env-update
Comment 1 Brian Toovey 2004-11-13 14:59:08 UTC
root@tumbleweed05 bin # emerge info
Portage 2.0.51-r3 (default-x86-2004.2, gcc-3.3.4, glibc-2.3.4.20040808-r1, 2.6.9-gentoo-r1 i686)
=================================================================
System uname: 2.6.9-gentoo-r1 i686 Mobile Intel(R) Pentium(R) 4 - M CPU 2.00GHz
Gentoo Base System version 1.4.16
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.14.90.0.8-r1
Headers:  sys-kernel/linux-headers-2.4.21-r1
Libtools: sys-devel/libtool-1.5.2-r5
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer -ffast-math -falign-functions=4 -fprefetch-loop-arrays"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer -ffast-math -falign-functions=4 -fprefetch-loop-arrays"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache distlocks sandbox"
GENTOO_MIRRORS="http://mirror.datapipe.net/gentoo http://mirror.datapipe.net/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X aim alsa apache2 apm arts avi bash berkdb bitmap-fonts cdr crypt cups dvd encode esd f77 foomaticdb fortran gdbm gif gpm gtk2 imlib java joystick jpeg kde ldap libg++ libwww mad mikmod motif mp3 mpeg mpeg4 mysql ncurses nls oggvorbis opengl pam pcmcia pdflib perl php png python qt quicktime readline sdl slang spell ssl svga tcltk tcpd tetex truetype vim vim-with-x x86 xemacs xine xml2 xmms xv yahoo zlib"
Comment 2 Brian Toovey 2004-11-13 15:29:03 UTC
I commented out the following from /usr/lib/portage/pym/portage.py

                #ld.so.conf needs updating and ldconfig needs to be run
                myfd=open(root+"etc/ld.so.conf","w")
                myfd.write("# ld.so.conf autogenerated by env-update; make all changes to\n")
                myfd.write("# contents of /etc/env.d directory\n")
                for x in specials["LDPATH"]:
                        myfd.write(x+"\n")
                myfd.close()
                ld_cache_update=True

        # Update prelink.conf if we are prelink-enabled
#       if prelink_capable:
#               newprelink=open(root+"etc/prelink.conf","w")
#               newprelink.write("# prelink.conf autogenerated by env-update; make all changes to\n")
#               newprelink.write("# contents of /etc/env.d directory\n")
#
#               for x in ["/bin","/sbin","/usr/bin","/usr/sbin","/lib","/usr/lib"]:
#                       newprelink.write("-l "+x+"\n");
#               for x in specials["LDPATH"]+specials["PATH"]+specials["PRELINK_PATH"]:
#                       if not x:
#                               continue
#                       plmasked=0
#                       for y in specials["PRELINK_PATH_MASK"]:
#                               if y[-1]!='/':
#                                       y=y+"/"
#                               if y==x[0:len(y)]:
#                                       plmasked=1
#                                       break
#                       if not plmasked:
#                               newprelink.write("-h "+x+"\n")
#               for x in specials["PRELINK_PATH_MASK"]:
#                       newprelink.write("-b "+x+"\n")
#               newprelink.close()

        if not mtimedb.has_key("ldpath"):
                mtimedb["ldpath"]={}

        for x in specials["LDPATH"]+['/usr/lib','/lib']:
                try:
                        newldpathtime=os.stat(x)[stat.ST_MTIME]
                except SystemExit, e:
                        raise
                except:
                        newldpathtime=0
                if mtimedb["ldpath"].has_key(x):
                        if mtimedb["ldpath"][x]==newldpathtime:
                                pass


Works now, but not sure of the impact - please advise the impact until a fix is available.

Thanks,
Brian

>>> Merging app-shells/bash-2.05b-r9 to /
--- /usr/
--- /usr/bin/
>>> /usr/bin/bashbug
--- /usr/share/
--- /usr/share/man/
--- /usr/share/man/man1/
>>> /usr/share/man/man1/rbash.1.gz
>>> /usr/share/man/man1/bash.1.gz
>>> /usr/share/man/man1/bashbug.1.gz
>>> /usr/share/man/man1/builtins.1.gz
--- /usr/share/info/
>>> /usr/share/info/bashref.info.gz -> bash.info.gz
>>> /usr/share/info/bash.info.gz
--- /usr/share/doc/
--- /usr/share/doc/bash-2.05b-r9/
>>> /usr/share/doc/bash-2.05b-r9/README.gz
>>> /usr/share/doc/bash-2.05b-r9/NEWS.gz
>>> /usr/share/doc/bash-2.05b-r9/AUTHORS.gz
>>> /usr/share/doc/bash-2.05b-r9/CHANGES.gz
>>> /usr/share/doc/bash-2.05b-r9/COMPAT.gz
>>> /usr/share/doc/bash-2.05b-r9/Y2K.gz
>>> /usr/share/doc/bash-2.05b-r9/FAQ.gz
>>> /usr/share/doc/bash-2.05b-r9/INTRO.gz
--- /bin/
>>> /bin/bash
>>> /bin/sh -> bash
>>> /bin/rbash -> bash
>>> Safely unmerging already-installed instance...
--- !mtime obj /usr/share/man/man1/rbash.1.gz
--- !mtime obj /usr/share/man/man1/builtins.1.gz
--- !mtime obj /usr/share/man/man1/bashbug.1.gz
--- !mtime obj /usr/share/man/man1/bash.1.gz
--- !mtime obj /usr/share/info/bash.info.gz
--- !mtime obj /usr/share/doc/bash-2.05b-r9/Y2K.gz
--- !mtime obj /usr/share/doc/bash-2.05b-r9/README.gz
--- !mtime obj /usr/share/doc/bash-2.05b-r9/NEWS.gz
--- !mtime obj /usr/share/doc/bash-2.05b-r9/INTRO.gz
--- !mtime obj /usr/share/doc/bash-2.05b-r9/FAQ.gz
--- !mtime obj /usr/share/doc/bash-2.05b-r9/COMPAT.gz
--- !mtime obj /usr/share/doc/bash-2.05b-r9/CHANGES.gz
--- !mtime obj /usr/share/doc/bash-2.05b-r9/AUTHORS.gz
--- !mtime obj /usr/bin/bashbug
--- !mtime obj /bin/bash
--- !empty dir /usr/share/man/man1
--- !empty dir /usr/share/man
--- !empty dir /usr/share/info
--- !empty dir /usr/share/doc/bash-2.05b-r9
--- !empty dir /usr/share/doc
--- !empty dir /usr/share
--- !empty dir /usr/bin
--- !empty dir /usr
--- !empty dir /bin
--- !targe sym /usr/share/info/bashref.info.gz
--- !targe sym /bin/sh
--- !targe sym /bin/rbash
>>> original instance of package unmerged safely.
>>> Regenerating /etc/ld.so.cache...
 * Caching service dependencies...
>>> app-shells/bash-2.05b-r9 merged.

 app-shells/bash
    selected: 3.0-r7
   protected: 2.05b-r9
     omitted: none

>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

>>> Waiting 5 seconds before starting...
>>> (Control-C to abort)...
>>> Unmerging in: 5 4 3 2 1
>>> Unmerging app-shells/bash-3.0-r7...
No package files given... Grabbing a set.
--- !mtime obj /usr/share/man/man1/rbash.1.gz
--- !mtime obj /usr/share/man/man1/builtins.1.gz
--- !mtime obj /usr/share/man/man1/bashbug.1.gz
--- !mtime obj /usr/share/man/man1/bash.1.gz
<<<        obj /usr/share/locale/en@quot/LC_MESSAGES/bash.mo
<<<        obj /usr/share/locale/en@boldquot/LC_MESSAGES/bash.mo
--- !mtime obj /usr/share/info/bash.info.gz
<<<        obj /usr/share/doc/bash-3.0-r7/Y2K.gz
<<<        obj /usr/share/doc/bash-3.0-r7/README.gz
<<<        obj /usr/share/doc/bash-3.0-r7/NEWS.gz
<<<        obj /usr/share/doc/bash-3.0-r7/INTRO.gz
<<<        obj /usr/share/doc/bash-3.0-r7/FAQ.gz
<<<        obj /usr/share/doc/bash-3.0-r7/COMPAT.gz
<<<        obj /usr/share/doc/bash-3.0-r7/CHANGES.gz
<<<        obj /usr/share/doc/bash-3.0-r7/AUTHORS.gz
--- !mtime obj /usr/bin/bashbug
--- cfgpro obj /etc/bash/bashrc
--- cfgpro dir /etc/bash
--- !mtime obj /bin/bash
<<<        dir /usr/share/doc/bash-3.0-r7
--- !empty dir /usr/share/man/man1
--- !empty dir /usr/share/man
--- !empty dir /usr/share/locale/en@quot/LC_MESSAGES
--- !empty dir /usr/share/locale/en@quot
--- !empty dir /usr/share/locale/en@boldquot/LC_MESSAGES
--- !empty dir /usr/share/locale/en@boldquot
--- !empty dir /usr/share/locale
--- !empty dir /usr/share/info
--- !empty dir /usr/share/doc
--- !empty dir /usr/share
--- !empty dir /usr/bin
--- !empty dir /usr
--- !empty dir /etc
--- !empty dir /bin
--- !targe sym /usr/share/info/bashref.info.gz
--- !targe sym /bin/sh
--- !targe sym /bin/rbash
>>> Regenerating /etc/ld.so.cache...
 * Caching service dependencies...
>>> Regenerating /etc/ld.so.cache...
 * Caching service dependencies...
>>> Auto-cleaning packages ...

>>> No outdated packages were found on your system.


 * Regenerating GNU info directory index...
 * Processed 275 info files.
Comment 3 Nicholas Jones (RETIRED) gentoo-dev 2005-02-28 09:21:33 UTC
This is the result of a syntax error in a config file.

Old and very unlikely to be reproduced. The TB is a good thing, but could
be printed cleaner.