Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 46271 - "execve() arg 3 contains a non-string value" upon invalid CONTENTS
Summary: "execve() arg 3 contains a non-string value" upon invalid CONTENTS
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: Normal minor (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
: 112989 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-03-30 12:01 UTC by Juri Memmert
Modified: 2006-01-03 21:13 UTC (History)
3 users (show)

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


Attachments
A small script to print out environment info (test.py,263 bytes, text/plain)
2005-08-06 18:14 UTC, Alec Warner (RETIRED)
Details
The output of the script (result.txt,6.57 KB, text/plain)
2005-08-07 00:42 UTC, Juri Memmert
Details
A patch to pickle the spawn env (for debugging only) (debug-spawn-env.patch,523 bytes, patch)
2005-08-07 19:48 UTC, Zac Medico
Details | Diff
tarball of /var/db/pkg/media-libs/libid3tag-0.15.0b (libid3tag.tar.gz,1.95 KB, application/x-gzip)
2005-08-09 06:08 UTC, Juri Memmert
Details
truncated contents file (adjusted-contents,835 bytes, text/plain)
2005-08-09 06:32 UTC, Brian Harring (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Juri Memmert 2004-03-30 12:01:09 UTC
When I upgraded libid3tag from version 0.15.0b to 0.15.1b (during the last emerge -U world), the emerge of the new version worked without problems, but emerge then failed with the trace below while unmerging 0.15.0b.
Trying to unmerge libid3tag-0.15.0b with emerge -C fails with the same error.
libid3tag-0.15.1b, on the other hanb, can be unmerged without error.


Backtrace:

 media-libs/libid3tag
    selected: 0.15.0b
   protected: 0.15.1b
     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 media-libs/libid3tag-0.15.0b...
No package files given... Grabbing a set.
Traceback (most recent call last):
  File "/usr/bin/emerge", line 2599, in ?
    mydepgraph.merge(mydepgraph.altlist())
  File "/usr/bin/emerge", line 1600, in merge
    retval=unmerge("clean", [xsplit[0]])
  File "/usr/bin/emerge", line 1852, in unmerge
    retval=portage.unmerge(mysplit[0],mysplit[1],portage.root,mysettings,unmerge_action not in ["clean","prune"])
  File "/usr/lib/portage/pym/portage.py", line 2496, in unmerge
    mylink.unmerge(trimworld=mytrimworld,cleanup=1)
  File "/usr/lib/portage/pym/portage.py", line 5241, in unmerge
    spawn("bzip2 -d "+self.dbdir+"/environment.bz2",self.settings,free=1)
  File "/usr/lib/portage/pym/portage.py", line 1565, in spawn
    os.execve(mycommand,myargs,mysettings.environ())
TypeError: execve() arg 3 contains a non-string value
Traceback (most recent call last):
  File "/usr/bin/emerge", line 2599, in ?
    mydepgraph.merge(mydepgraph.altlist())
  File "/usr/bin/emerge", line 1600, in merge
    retval=unmerge("clean", [xsplit[0]])
  File "/usr/bin/emerge", line 1852, in unmerge
    retval=portage.unmerge(mysplit[0],mysplit[1],portage.root,mysettings,unmerge_action not in ["clean","prune"])
  File "/usr/lib/portage/pym/portage.py", line 2496, in unmerge
    mylink.unmerge(trimworld=mytrimworld,cleanup=1)
  File "/usr/lib/portage/pym/portage.py", line 5252, in unmerge
    a=doebuild(myebuildpath,"prerm",self.myroot,self.settings,cleanup=cleanup,use_cache=0)
  File "/usr/lib/portage/pym/portage.py", line 2268, in doebuild
    return spawn("/usr/sbin/ebuild.sh "+mydo,mysettings,debug,free=1)
  File "/usr/lib/portage/pym/portage.py", line 1565, in spawn
    os.execve(mycommand,myargs,mysettings.environ())
TypeError: execve() arg 3 contains a non-string value
!!! FAILED prerm: 1
Comment 1 Nicholas Jones (RETIRED) gentoo-dev 2004-04-11 00:49:50 UTC
Post the output of this please:

python -c 'import portage; portage.settings.environ()'
Comment 2 Juri Memmert 2004-04-11 02:47:49 UTC
Erm... Nothing? Or did I miss something?
Comment 3 Creede Lambard 2004-11-21 01:41:27 UTC
I am running into a similar error. I upgraded to a new hard drive because the old one was failing on me, so although in general Gentoo currently works properly, I have two major bugs I am working on now. This is one of them.

When I emerge anything portage tries to unmerge an older version of db, which is expected behavior. However, I get this message when it tries to remove the old package:

----------------------- begin -----------------------------------

 sys-libs/db
    selected: 1.85-r1
   protected: 1.85-r2 3.2.9-r6 4.1.25_p1-r4 4.0.14-r2 4.2.52_p2
     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 sys-libs/db-1.85-r1...
No package files given... Grabbing a set.
Traceback (most recent call last):
  File "/usr/bin/emerge", line 2997, in ?
    unmerge("clean", ["world"])
  File "/usr/bin/emerge", line 2167, in unmerge
    retval=portage.unmerge(mysplit[0],mysplit[1],portage.root,mysettings,unmerge_action not in ["clean","prune"])
  File "/usr/lib/portage/pym/portage.py", line 2700, in unmerge
    mylink.unmerge(trimworld=mytrimworld,cleanup=1)
  File "/usr/lib/portage/pym/portage.py", line 5925, in unmerge
    spawn("bzip2 -d "+self.dbdir+"/environment.bz2",self.settings,free=1)
  File "/usr/lib/portage/pym/portage.py", line 1507, in spawn
    return portage_exec.spawn_bash(mystring,env=env,**keywords)
  File "/usr/lib/portage/pym/portage_exec.py", line 44, in spawn_bash
    return spawn(args,env=env,opt_name=opt_name,**keywords)
  File "/usr/lib/portage/pym/portage_exec.py", line 167, in spawn
    raise str(e)+":\n   "+myc+" "+string.join(myargs)
execve() arg 3 contains a non-string value:
   /bin/bash [db-1.85-r1] bash -c bzip2 -d /var/db/pkg/sys-libs/db-1.85-r1/environment.bz2
Traceback (most recent call last):
  File "/usr/bin/emerge", line 2997, in ?
    unmerge("clean", ["world"])
  File "/usr/bin/emerge", line 2167, in unmerge
    retval=portage.unmerge(mysplit[0],mysplit[1],portage.root,mysettings,unmerge_action not in ["clean","prune"])
  File "/usr/lib/portage/pym/portage.py", line 2700, in unmerge
    mylink.unmerge(trimworld=mytrimworld,cleanup=1)
  File "/usr/lib/portage/pym/portage.py", line 5936, in unmerge
    a=doebuild(myebuildpath,"prerm",self.myroot,self.settings,cleanup=cleanup,use_cache=0,tree="vartree")
  File "/usr/lib/portage/pym/portage.py", line 2465, in doebuild
    return spawn(EBUILD_SH_BINARY+" "+mydo,mysettings,debug=debug,free=1,logfile=logfile)
  File "/usr/lib/portage/pym/portage.py", line 1507, in spawn
    return portage_exec.spawn_bash(mystring,env=env,**keywords)
  File "/usr/lib/portage/pym/portage_exec.py", line 44, in spawn_bash
    return spawn(args,env=env,opt_name=opt_name,**keywords)
  File "/usr/lib/portage/pym/portage_exec.py", line 167, in spawn
    raise str(e)+":\n   "+myc+" "+string.join(myargs)
execve() arg 3 contains a non-string value:
   /bin/bash [db-1.85-r1] bash -c /usr/lib/portage/bin/ebuild.sh prerm
!!! FAILED prerm: 1

------------------------------- end --------------------------------------

By the way, your output request omitted a small yet significant component. :) Here is the output I get when I run "python -c 'import portage; print portage.settings.environ()'":

----------------------- begin -----------------------------------

{'LESS': '-R', 'RESUMECOMMAND': '/usr/bin/wget -c -t 5 --passive-ftp -P ${DISTDIR} ${URI}', 'DISTDIR': '/usr/portage/distfiles', 'INFOPATH': '/usr/share/info:/usr/share/gcc-data/i686-pc-linux-gnu/3.4/info', 'LINUX_PORTAGE_WRITABLE': 'yes', 'MANPATH': '/usr/local/share/man:/usr/share/man:/usr/share/gcc-data/i686-pc-linux-gnu/3.4/man:/usr/share/man::/opt/blackdown-jdk-1.4.2/man:/usr/qt/3/man:/usr/qt/3/doc/man:/opt/vmware/man', 'JAVA_HOME': '/opt/blackdown-jdk-1.4.2', 'PORTAGE_TMPDIR': '/var/tmp', 'KDE_MALLOC': '1', 'ACCEPT_KEYWORDS': 'x86 ~x86', 'DESKTOP_SESSION': 'fluxbox', 'HOSTNAME': 'boris', 'FETCHCOMMAND': '/usr/bin/proz --no-getch -s ${URI} -P ${DISTDIR}', 'LS_COLORS': 'no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mng=01;35:*.xcf=01;35:*.pcx=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.avi=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.mov=01;35:*.qt=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.pdf=00;32:*.ps=00;32:*.txt=00;32:*.log=00;32:*.tex=00;32:*.doc=00;32:*.mp3=00;36:*.wav=00;36:*.mid=00;36:*.midi=00;36:*.au=00;36:*.ogg=00;36:', 'LADSPA_PATH': '/usr/lib/ladspa', 'SYNC': 'rsync://rsync.namerica.gentoo.org/gentoo-portage', 'LESSOPEN': '|lesspipe.sh %s', 'CVS_RSH': 'ssh', 'USER': 'creede', 'HOME': '/root', 'PS1': '\\[\\033[01;31m\\]\\h \\[\\033[01;34m\\]\\W \\$ \\[\\033[00m\\]', 'GLIBC_SSP_CHECKED': '1', 'USERLAND': 'GNU', 'JDK_HOME': '/opt/blackdown-jdk-1.4.2', 'GENTOO_MIRRORS': 'http://gentoo.llarian.net/ http://gentoo.binarycompass.org http://mirrors.tds.net/gentoo', 'SHLVL': '3', 'CONFIG_PROTECT_MASK': '/etc/gconf /etc/terminfo /etc/env.d', 'QMAKESPEC': 'linux-g++', 'RPMDIR': '/usr/portage/rpm', 'WINDOWID': '35724951', 'CHOST': 'i686-pc-linux-gnu', 'EDITOR': '/usr/bin/joe', 'USE_EXPAND': 'VIDEO_CARDS INPUT_DEVICES LINGUAS', 'CLASSPATH': '.', 'RSYNC_TIMEOUT': '180', 'AUTOCLEAN': 'yes', 'GDMSESSION': 'fluxbox', 'PORTAGE_ARCHLIST': 'alpha amd64 arm hppa ia64 m68k mips ppc ppc64 ppc-macos s390 sh sparc x86 x86-obsd x86-fbsd', 'BASH_ENV': '/etc/spork/is/not/valid/profile.env', 'RSYNC_RETRIES': '3', 'MOZILLA_FIVE_HOME': '/usr/lib/mozilla', 'GDK_USE_XFT': '1', 'CLEAN_DELAY': '5', 'PORTAGE_BINHOST_CHUNKSIZE': '3000', 'PRELINK_PATH': '', 'COLORTERM': 'gnome-terminal', 'PAGER': '/usr/bin/less', 'PYTHONDOCS': '/usr/share/doc/python-docs-2.3.4/html', 'FEATURES': 'autoaddcvs autoconfig ccache distlocks sandbox sfperms', 'PORTAGE_GID': '250', 'CXXFLAGS': '-march=athlon-xp -O3 -pipe -fomit-frame-pointer', 'QTDIR': '/usr/qt/3', 'DISPLAY': ':0.0', 'PORTAGE_MASTER_PID': '6175', 'KDEDIR': '/usr/kde/3.3', 'ACCEPT_LICENSE': '', 'PRELINK_PATH_MASK': '', 'G_BROKEN_FILENAMES': '1', 'AUTO_SYMLINK': 'yes', '_': '/usr/bin/python', 'MAKEOPTS': '-j2', 'XARGS': 'xargs -r', 'XPSERVERLIST': '', 'XINITRC': '/etc/X11/xinit/xinitrc', 'KDEDIRS': '/usr', 'PKGDIR': '/usr/portage/packages', 'CONFIG_PROTECT': '/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/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/lib/mozilla/defaults/pref /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', 'USERNAME': 'creede', 'USE': '3dnow X aalib alsa apache2 apm arts avi berkdb bitmap-fonts cdr cjk crypt cups dga directfb dvd emacs encode esd f77 fam fbcon flac flash foomaticdb fortran gdbm gif gimp gimpprint gnome gpm gstreamer gtk gtk2 gtkhtml guile imagemagick imap imlib jack java jpeg kde kerberos ldap libg++ libwww live mad maildir mikmod mmx motif mozilla mpeg mysql nas ncurses network nls nols nvidia oggvorbis opengl oss pam pda pdflib perl png pnp python qt quicktime readline rtc samba sdl slang sndfile speex spell sse ssl svga tcltk tcpd tetex tiff truetype usb videos x86 xml xml2 xmms xv zlib', 'MOZILLA_XFT': '1', 'GUILE_LOAD_PATH': '/usr/share/guile/1.6', 'LOGNAME': 'creede', 'PATH': '/sbin:/bin:/usr/sbin:/usr/bin', 'ARCH': 'x86', 'SSH_AGENT_PID': '601', 'TERM': 'xterm', 'ALSA_CARDS': 'emu10k1', 'KBUILD_OUTPUT_PREFIX': '/var/tmp/kernel-output', 'SSH_AUTH_SOCK': '/tmp/ssh-MlzHnSx579/agent.579', 'GRP_STAGE23_USE': 'ipv6 pam tcpd readline nls ssl gpm perl python berkdb acl ncurses', 'NOCOLOR': 'false', 'LC_ALL': 'C', 'IRCNAME': 'Illuminated Penguin', 'XAUTHORITY': '/root/.xauthKo0Zji', 'JAVAC': '/opt/blackdown-jdk-1.4.2/bin/javac', 'PWD': '/home/creede', 'CFLAGS': '-march=athlon-xp -O3 -pipe -fomit-frame-pointer', 'PORTDIR': '/usr/portage'}

------------------------------- end --------------------------------------
Comment 4 Creede Lambard 2004-12-03 12:28:51 UTC
Here's a bit more information on the error above. I added a line to show me what was going on with the execve arguments, and it printed out;

Now execing /bin/bash with arguments ['[db-1.85-r1] bash', '-c', '/usr/lib/portage/bin/ebuild.sh prerm']

So it appears that there is no argument 3, which is why it would be a non-string value. I don't know what's supposed to be there, otherwise I'd just add it manually and go on with my life.

Thanks for looking at this.
Comment 5 Brian Harring (RETIRED) gentoo-dev 2005-02-28 00:28:40 UTC
Still an issue?
Comment 6 Juri Memmert 2005-02-28 18:21:29 UTC
Yes, it's still an issue... Same error message still.

mailx has the same issue.

 mail-client/mailx
    selected: 8.1.2.20021129-r2 8.1.2.20021129-r4
   protected: 8.1.2.20040524-r1
Comment 7 Alec Warner (RETIRED) archtester gentoo-dev Security 2005-08-06 07:53:34 UTC
Can you reproduce this on latest stable?  It appears that your environment is 
not propogating properly through to the spawn() call.
Comment 8 Juri Memmert 2005-08-06 08:11:57 UTC
I just retried emerging libid3tag (0.15.1b) and the same error occured.

Here's the infrmation I can gather:

emerge info:
Portage 2.0.51.22-r2 (default-linux/x86/2005.0, gcc-3.3.5-20050130,
glibc-2.3.5-r0, 2.6.12-suspend2-r2 i686)
=================================================================
System uname: 2.6.12-suspend2-r2 i686 Intel(R) Pentium(R) 4 CPU 3.20GHz
Gentoo Base System version 1.6.13
ccache version 2.3 [enabled]
dev-lang/python:     2.2.3-r1, 2.3.5
sys-apps/sandbox:    1.2.11
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5
sys-devel/binutils:  2.15.92.0.2-r10
sys-devel/libtool:   1.5.18-r1
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -funroll-loops -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.1/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.4/env /usr/kde/3.4/share/config
/usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb
/usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=i686 -funroll-loops -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig buildpkg ccache distlocks fixpackages sandbox sfperms strict"
GENTOO_MIRRORS="ftp://pandemonium.tiscali.de/pub/gentoo/
http://pandemonium.tiscali.de/pub/gentoo/ ftp://mirror.switch.ch/mirror/gentoo/
ftp://gd.tuwien.ac.at/opsys/linux/gentoo/
http://gd.tuwien.ac.at/opsys/linux/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X a52 aac aalib acpi alsa apm arts avi berkdb bitmap-fonts bonobo cdr
crypt cups curl dvb dvd dvdread eds emboss encode esd fam ffmpeg flac foomaticdb
fortran gd gdbm gif gnome gpm gstreamer gtk gtk2 gtkhtml guile imagemagick imlib
ipv6 java jpeg junit kde ldap libg++ libwww mad matroska mikmod mmx mmxext motif
mozilla mp3 mpeg mysql ncurses nls ogg oggvorbis opengl oss pam pdflib perl png
postgres python qt quicktime readline samba sdl slang spell sqlite ssl svga
tcltk tcpd tiff truetype truetype-fonts type1-fonts vcd vorbis win32codecs
wxwindows xine xml xml2 xmms xv xvid zlib video_cards_radeon video_cards_-sis
video_cards_-rage128 video_cards_-matrox video_cards_-3dfx video_cards_-gamma
video_cards_-i8x0 userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS


the last lines of the unmerging attempt:
>>> original instance of package unmerged safely.
>>> Regenerating /etc/ld.so.cache...
>>> media-libs/libid3tag-0.15.1b merged.
>>> Recording media-libs/libid3tag in "world" favorites file...

 media-libs/libid3tag
    selected: 0.15.0b
   protected: 0.15.1b
     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 media-libs/libid3tag-0.15.0b...
No package files given... Grabbing a set.
Traceback (most recent call last):
  File "/usr/bin/emerge", line 3200, in ?
    mydepgraph.merge(mydepgraph.altlist())
  File "/usr/bin/emerge", line 1966, in merge
    retval=unmerge("clean", [xsplit[0]])
  File "/usr/bin/emerge", line 2251, in unmerge
   
retval=portage.unmerge(mysplit[0],mysplit[1],portage.root,mysettings,unmerge_action
not in ["clean","prune"])
  File "/usr/lib/portage/pym/portage.py", line 2901, in unmerge
    mylink.unmerge(trimworld=mytrimworld,cleanup=1)
  File "/usr/lib/portage/pym/portage.py", line 6119, in unmerge
    spawn("bzip2 -d "+self.dbdir+"/environment.bz2",self.settings,free=1)
  File "/usr/lib/portage/pym/portage.py", line 1603, in spawn
    return portage_exec.spawn_bash(mystring,env=env,**keywords)
  File "/usr/lib/portage/pym/portage_exec.py", line 48, in spawn_bash
    return spawn(args,env=env,opt_name=opt_name,**keywords)
  File "/usr/lib/portage/pym/portage_exec.py", line 164, in spawn
    raise str(e)+":\n   "+myc+" "+string.join(myargs)
execve() arg 3 contains a non-string value:
   /bin/bash [libid3tag-0.15.0b] bash -c bzip2 -d
/var/db/pkg/media-libs/libid3tag-0.15.0b/environment.bz2
Traceback (most recent call last):
  File "/usr/bin/emerge", line 3200, in ?
    mydepgraph.merge(mydepgraph.altlist())
  File "/usr/bin/emerge", line 1966, in merge
    retval=unmerge("clean", [xsplit[0]])
  File "/usr/bin/emerge", line 2251, in unmerge
   
retval=portage.unmerge(mysplit[0],mysplit[1],portage.root,mysettings,unmerge_action
not in ["clean","prune"])
  File "/usr/lib/portage/pym/portage.py", line 2901, in unmerge
    mylink.unmerge(trimworld=mytrimworld,cleanup=1)
  File "/usr/lib/portage/pym/portage.py", line 6130, in unmerge
   
a=doebuild(myebuildpath,"prerm",self.myroot,self.settings,cleanup=cleanup,use_cache=0,tree="vartree")
  File "/usr/lib/portage/pym/portage.py", line 2611, in doebuild
    return spawn(EBUILD_SH_BINARY+"
"+mydo,mysettings,debug=debug,free=1,logfile=logfile)
  File "/usr/lib/portage/pym/portage.py", line 1603, in spawn
    return portage_exec.spawn_bash(mystring,env=env,**keywords)
  File "/usr/lib/portage/pym/portage_exec.py", line 48, in spawn_bash
    return spawn(args,env=env,opt_name=opt_name,**keywords)
  File "/usr/lib/portage/pym/portage_exec.py", line 164, in spawn
    raise str(e)+":\n   "+myc+" "+string.join(myargs)
execve() arg 3 contains a non-string value:
   /bin/bash [libid3tag-0.15.0b] bash -c /usr/lib/portage/bin/ebuild.sh prerm
!!! FAILED prerm: 1


I hope that helps.
Comment 9 Alec Warner (RETIRED) archtester gentoo-dev Security 2005-08-06 09:21:05 UTC
(In reply to comment #1)
> Post the output of this please:
> 
> python -c 'import portage; portage.settings.environ()'

Juri, please run the above.  It should print out something similar to comment 
#3.
Comment 10 Juri Memmert 2005-08-06 10:17:11 UTC
I ran

python -c 'import portage; portage.settings.environ()'

as asked and while the processor does a whole lot of stuff (execution takes
arounc 10 seconds) and strace tells me that a whole wagonload of operations are
performed, nothing is sent to the console.
Comment 11 Juri Memmert 2005-08-06 14:37:07 UTC
Executing
python -c 'import portage; print portage.settings.environ()'

delivers:

{'LADSPA_PATH': '/usr/lib/ladspa', 'ELIBC': 'glibc', 'USE': 'x86 X a52 aac acpi
alsa apm arts avi berkdb bitmap-fonts crypt cups dvb dvd dvdread eds emboss
encode ffmpeg foomaticdb fortran gdbm gif gnome gpm gstreamer gtk gtk2 imlib
ipv6 jpeg kde libg++ libwww mad matroska mikmod mmx mmxext motif mp3 mpeg
ncurses nls ogg oggvorbis opengl oss pam pdflib perl png python qt quicktime
readline sdl spell ssl tcpd truetype truetype-fonts type1-fonts vcd vorbis
win32codecs wxwindows xine xml2 xmms xv xvid zlib video_cards_radeon
video_cards_-sis video_cards_-rage128 video_cards_-matrox video_cards_-3dfx
video_cards_-gamma video_cards_-i8x0 userland_GNU kernel_linux elibc_glibc',
'FEATURES': 'autoconfig buildpkg ccache distlocks fixpackages sandbox sfperms
strict', 'LESS': '-R', 'PORTAGE_GID': '250', 'SYNC':
'rsync://rsync.gentoo.org/gentoo-portage', 'LESSOPEN': '|lesspipe.sh %s',
'CXXFLAGS': '-O2 -march=i686 -funroll-loops -pipe', 'KERNEL': 'linux',
'CVS_RSH': 'ssh', 'LOGNAME': 'root', 'OPENGL_PROFILE': 'ati', 'HOME': '/root',
'QTDIR': '/usr/qt/3', 'GUILE_LOAD_PATH': '/usr/share/guile/1.6', 'CBUILD':
'i686-pc-linux-gnu', 'ARCH': 'x86', 'DISPLAY': ':0.0', 'PORTAGE_MASTER_PID':
'17793', 'KDEDIR': '/usr/kde/3.2', 'ACCEPT_LICENSE': '', 'SHELL': '/bin/bash',
'USERLAND': 'GNU', 'JDK_HOME': '/opt/sun-jdk-1.4.2.08',
'LINUX_PORTAGE_WRITABLE': 'no', 'GENTOO_MIRRORS':
'ftp://pandemonium.tiscali.de/pub/gentoo/
http://pandemonium.tiscali.de/pub/gentoo/ ftp://mirror.switch.ch/mirror/gentoo/
ftp://gd.tuwien.ac.at/opsys/linux/gentoo/
http://gd.tuwien.ac.at/opsys/linux/gentoo/', 'SHLVL': '1',
'CONFIG_PROTECT_MASK': '/etc/gconf /etc/splash /etc/terminfo /etc/env.d',
'G_BROKEN_FILENAMES': '1', 'PORTAGE_BINHOST_CHUNKSIZE': '3000', 'CATALINA_HOME':
'/opt/tomcat5', 'QMAKESPEC': 'linux-g++', 'RPMDIR': '/usr/portage/rpm',
'PORTDIR': '/usr/portage', 'CHOST': 'i686-pc-linux-gnu', 'EDITOR': '/bin/nano',
'MANPATH':
'/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/i686-pc-linux-gnu/2.15.92.0.2/man:/usr/share/gcc-data/i686-pc-linux-gnu/3.3.5-20050130/man::/opt/sun-jdk-1.4.2.08/man:/usr/qt/3/doc/man:/opt/vmware/man',
'RESUMECOMMAND': '/usr/bin/wget -c -t 5 --passive-ftp -P ${DISTDIR} ${URI}',
'JAVA_HOME': '/opt/sun-jdk-1.4.2.08', 'GRP_STAGE23_USE': 'ipv6 pam tcpd readline
nls ssl gpm perl python berkdb ncurses', 'AUTOCLEAN': 'yes', 'PORTAGE_TMPDIR':
'/var/tmp', 'MAKEOPTS': '-j2', 'XARGS': 'xargs -r', 'KDE_MALLOC': '1',
'EMERGE_WARNING_DELAY': '10', 'USE_EXPAND': 'FRITZCAPI_CARDS FCDSL_CARDS
VIDEO_CARDS INPUT_DEVICES LINGUAS USERLAND KERNEL ELIBC', 'INFOPATH':
'/usr/share/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.15.92.0.2/info:/usr/share/gcc-data/i686-pc-linux-gnu/3.3.5-20050130/info',
'ACCEPT_KEYWORDS': 'x86', 'PYTHONPATH': '/usr/lib/portage/pym', 'CLASSPATH':
'.', 'TERM': 'xterm', 'RSYNC_TIMEOUT': '180', 'GCC_SPECS': '', 'PATH':
'/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/3.3.5-20050130:/opt/ati/bin:/opt/ghc/bin:/opt/sun-jdk-1.4.2.08/bin:/opt/sun-jdk-1.4.2.08/jre/bin:/opt/sun-jdk-1.4.2.08/jre/javaws:/usr/qt/3/bin:/usr/kde/3.4/sbin:/usr/kde/3.4/bin:/usr/kde/3.3/sbin:/usr/kde/3.3/bin:/usr/kde/3.2/sbin:/usr/kde/3.2/bin:/usr/kde/3.1/sbin:/usr/kde/3.1/bin:/usr/qt/2/bin:/opt/vmware/bin',
'PORTAGE_ARCHLIST': 'alpha amd64 arm hppa ia64 m68k mips ppc ppc64 ppc-macos
ppc-od s390 sh sparc x86 x86-fbsd x86-obsd x86-od', 'VIDEO_CARDS': 'radeon -sis
-rage128 -matrox -3dfx -gamma -i8x0', 'PRELINK_PATH_MASK':
'/usr/lib/gstreamer-0.8', 'ANT_HOME': '/usr/share/ant-core', 'BASH_ENV':
'/etc/spork/is/not/valid/profile.env', 'XINITRC': '/etc/X11/xinit/xinitrc',
'AUTO_SYMLINK': 'no', '_': '/usr/bin/python', 'XAUTHORITY':
'/root/.xauthAYP7rh', 'KDEDIRS': '/usr', 'RSYNC_RETRIES': '3', 'DISTDIR':
'/usr/portage/distfiles', 'PKGDIR': '/packages', 'JAVAC':
'/opt/sun-jdk-1.4.2.08/bin/javac', 'MOZILLA_FIVE_HOME': '/usr/lib/mozilla',
'GDK_USE_XFT': '1', 'HOSTNAME': 'jpmlap02.jpmdesign.de', 'CLEAN_DELAY': '5',
'CONFIG_PROTECT': '/etc /usr/kde/2/share/config /usr/kde/3.1/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.4/env /usr/kde/3.4/share/config
/usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb
/usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control',
'PORTDIR_OVERLAY': '/usr/local/portage', 'PWD': '/root', 'PRELINK_PATH': '',
'CFLAGS': '-O2 -march=i686 -funroll-loops -pipe', 'FETCHCOMMAND': '/usr/bin/wget
-t 5 --passive-ftp -P ${DISTDIR} ${URI}', 'MAIL': '/var/mail/root', 'PAGER':
'/usr/bin/less', 'KBUILD_OUTPUT_PREFIX': '', 'USER': 'root'}

I hope that helps.
Comment 12 Zac Medico gentoo-dev 2005-08-06 15:54:19 UTC
The error message reports that the "env" argument of execve(path, args, env)
contains a non-string value:

execve() arg 3 contains a non-string value:
   /bin/bash [db-1.85-r1] bash -c /usr/lib/portage/bin/ebuild.sh prerm
!!! FAILED prerm: 1

The portage.config class has __setitem__ type checking for the value but not for
the key.  Maybe we can do a type check on the key also since env keys are
supposed to be string values.
Comment 13 Alec Warner (RETIRED) archtester gentoo-dev Security 2005-08-06 18:14:54 UTC
Created attachment 65271 [details]
A small script to print out environment info

This should print out the environ keys,value pairs, and the type of the value. 
Either by defualt one of the values is not a str, or somewhere along the line
the value's type is changed.  Time to narrow down which.

Please attach the output as a file rather than pasting it in a comment as it
can be quite large.
Comment 14 Juri Memmert 2005-08-07 00:42:36 UTC
Created attachment 65290 [details]
The output of the script

As requested, the output of the script found at
http://bugs.gentoo.org/attachment.cgi?id=65271&action=view
Comment 15 Zac Medico gentoo-dev 2005-08-07 19:48:10 UTC
Created attachment 65378 [details, diff]
A patch to pickle the spawn env (for debugging only)

This patch allows you to save the env just before the reported error occurs. 
After the patch is applied, the evironment variable DEBUG_ENV_PICKLE specifies
an output file for the env pickle.  Hopefully the pickle with contain
sufficient information to debug this.
Comment 16 Alec Warner (RETIRED) archtester gentoo-dev Security 2005-08-07 20:46:56 UTC
I would gather it's invalid files in /var/db/pkg/media-libs/libid3tag-0.15.0b as 
it seems to be a package-specific problem.  You may want to check the contents 
of that directory to see if there is anything odd, however looking at the code 
that parses it even an incorrect entry should make it into the config as a 
string object.

Comment 17 Brian Harring (RETIRED) gentoo-dev 2005-08-09 03:32:21 UTC
please run (this is all on one line also, despite any wrapping that may occur)
python -c'import portage;print
dict(zip(portage.auxdbkeys,portage.db["/"]["vartree"].dbapi.aux_get("media-libs/libid3tag-0.15.0b",portage.auxdbkeys)))'

Assuming I haven't typoed it, that'll dump the metadata for that installed
package (if you've gotten past that package, run it for any package this bug
rears it's head on please).

I'd wonder about config.load_infodir doing something stupid also (like not
explicitly closing file objs as it's doing in load_infodir, yes it's easy, but
it's a bad habit).

Aside from that, please tarball up /var/db/pkg/media-libs/libid3tag-0.15.0b ,
and attach it to this bug (that and if you're game, run zac's pickling patch,
otherwise should be able to rule out candidates via the tarball).
Comment 18 Juri Memmert 2005-08-09 06:07:07 UTC
Running the script on "media-libs/libid3tag-0.15.0" delivers the following result:

{'LICENSE': 'GPL-2', 'RESTRICT': '', 'SRC_URI': '', 'KEYWORDS': '', 'RDEPEND':
'virtual/glibc >=sys-libs/zlib-1.1.3', 'SLOT': '0', 'DEPEND': 'virtual/glibc
>=sys-libs/zlib-1.1.3', 'IUSE': 'debug', 'UNUSED_04': '', 'HOMEPAGE': '',
'UNUSED_08': '', 'PROVIDE': '', 'UNUSED_05': '', 'UNUSED_06': '', 'UNUSED_07':
'', 'UNUSED_01': '', 'UNUSED_02': '', 'UNUSED_03': '', 'PDEPEND': '',
'INHERITED': '', 'DESCRIPTION': '', 'CDEPEND': ''}

Attachment in the next comment.
Running it on "mail-client/mailx-8.1.2.20021129-r2" delivers:

{'LICENSE': 'GPL-2', 'RESTRICT': '', 'SRC_URI': '', 'KEYWORDS': '', 'RDEPEND':
'>=net-libs/liblockfile-1.03 virtual/mta !net-mail/mailutils
net-mail/mailx-support', 'SLOT': '0', 'DEPEND': '>=net-libs/liblockfile-1.03
virtual/mta !net-mail/mailutils net-mail/mailx-support !bootstrap? (
sys-devel/patch )', 'IUSE': '', 'UNUSED_04': '', 'HOMEPAGE': '', 'UNUSED_08':
'', 'PROVIDE': '', 'UNUSED_05': '', 'UNUSED_06': '', 'UNUSED_07': '',
'UNUSED_01': '', 'UNUSED_02': '', 'UNUSED_03': '', 'PDEPEND': '', 'INHERITED':
'', 'DESCRIPTION': '', 'CDEPEND': ''}


Running it on "mail-client/mailx-8.1.2.20040524-r1" gives:

{'LICENSE': 'BSD', 'RESTRICT': '', 'SRC_URI': '', 'KEYWORDS': '', 'RDEPEND':
'>=net-libs/liblockfile-1.03 virtual/mta !mail-client/mailutils
mail-client/mailx-support !virtual/mailx', 'SLOT': '0', 'DEPEND':
'>=net-libs/liblockfile-1.03 virtual/mta !mail-client/mailutils
mail-client/mailx-support !virtual/mailx !bootstrap? ( sys-devel/patch )
!bootstrap? ( sys-devel/patch ) !bootstrap? ( sys-devel/patch )', 'IUSE': '',
'UNUSED_04': '', 'HOMEPAGE': '', 'UNUSED_08': '', 'PROVIDE': 'virtual/mailx',
'UNUSED_05': '', 'UNUSED_06': '', 'UNUSED_07': '', 'UNUSED_01': '', 'UNUSED_02':
'', 'UNUSED_03': '', 'PDEPEND': '', 'INHERITED': 'multilib eutils
toolchain-funcs flag-o-matic ccc', 'DESCRIPTION': '', 'CDEPEND': ''}
Comment 19 Juri Memmert 2005-08-09 06:08:01 UTC
Created attachment 65526 [details]
tarball of /var/db/pkg/media-libs/libid3tag-0.15.0b
Comment 20 Brian Harring (RETIRED) gentoo-dev 2005-08-09 06:17:11 UTC
Wow, that's fricking weird.
Danke for the tarball, can duplicate it locally now... fix coming shortly.
Comment 21 Brian Harring (RETIRED) gentoo-dev 2005-08-09 06:32:02 UTC
Created attachment 65531 [details]
truncated contents file

Short version, you're snagging on corruption.
CONTENTS file gets dumped into the env (don't ask, it's bad and is a sign of
bad code), the problem is your CONTENTS file is severely waxed.

If you replace /var/db/media-libs/libid3tag-0.15.0b/CONTENTS with the truncated
file, you'll be able to unmerge.
Comment 22 Juri Memmert 2005-08-09 06:37:48 UTC
Fixed it. Perfect. Does the same file work for the mailx problem as well?
Comment 23 Brian Harring (RETIRED) gentoo-dev 2005-08-09 06:38:17 UTC
closing, for any alternative packages that have this issue, reopen if contents
isn't corrupted; quick way of truncating contents btw is
head -n $( wc -l contents-file) > new-contents-file, and renaming it to CONTENTS
Comment 24 Brian Harring (RETIRED) gentoo-dev 2005-08-09 06:39:41 UTC
Should, yes.
specifically why os.execve is getting it's undies in a bunch is that the horked
contents file (which was loaded into the env, and handed into the prerm execve
call) had some very crazy characters that where pissing off python, nulls mainly.
Comment 25 Zac Medico gentoo-dev 2005-11-25 09:11:45 UTC
*** Bug 112989 has been marked as a duplicate of this bug. ***
Comment 26 Alec Warner (RETIRED) archtester gentoo-dev Security 2006-01-03 21:13:03 UTC
*** Bug 116756 has been marked as a duplicate of this bug. ***