Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 434496

Summary: app-portage/gentoolkit-0.3.0.6-r3 - equery crashes on unhandled exception portage.exception.InvalidDependString
Product: Portage Development Reporter: Niko Böckerman <gentoo.cart9>
Component: ToolsAssignee: Portage Tools Team <tools-portage>
Status: RESOLVED WORKSFORME    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Niko Böckerman 2012-09-09 18:23:57 UTC
Equery crashes with unhandled exception (portage.exception.InvalidDependString).

Reproducible: Always

Steps to Reproduce:
1. Run this command:
equery d -a kde-telepathy-meta

Actual Results:  
$ equery d -a kde-telepathy-meta
 * These packages depend on kde-telepathy-meta:
Traceback (most recent call last):
  File "/usr/bin/equery", line 38, in <module>
    equery.main(sys.argv)
  File "/usr/lib64/python2.7/site-packages/gentoolkit/equery/__init__.py", line 354, in main
    loaded_module.main(module_args)
  File "/usr/lib64/python2.7/site-packages/gentoolkit/equery/depends.py", line 199, in main
    printer_fn=dep_print
  File "/usr/lib64/python2.7/site-packages/gentoolkit/dependencies.py", line 243, in graph_reverse_depends
    all_depends = uniqify(pkgdep.get_all_depends())
  File "/usr/lib64/python2.7/site-packages/gentoolkit/dependencies.py", line 109, in get_all_depends
    return self.parser(' '.join(self.environment(env_vars)))
  File "/usr/lib64/python2.7/site-packages/gentoolkit/dependencies.py", line 293, in _parser
    deps = paren_reduce(deps)
  File "/usr/lib/portage/pym/portage/dep/__init__.py", line 351, in paren_reduce
    _("malformed syntax: '%s'") % mystr)
portage.exception.InvalidDependString: malformed syntax: '<sys-apps/portage-2.1 dev-python/python-cdb psyco? (dev-python/psyco)  '


Expected Results:  
Program to not crash and show the packages that could depend on kde-telepathy-meta.

$ emerge --info
Portage 2.2.0_alpha124 (default/linux/amd64/10.0/desktop/kde, gcc-4.5.3, glibc-2.15-r2, 3.4.9-gentoo x86_64)
=================================================================
System uname: Linux-3.4.9-gentoo-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q9550_@_2.83GHz-with-gentoo-2.1
Timestamp of tree: Sun, 09 Sep 2012 17:45:01 +0000
distcc 3.1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.2_p37
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.3-r2, 3.2.3
dev-util/cmake:           2.8.8-r3
dev-util/pkgconfig:       0.27
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.9.8.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.11.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.5.3-r2, 4.6.3, 4.7.1
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.1 (virtual/os-headers)
sys-libs/glibc:           2.15-r2
Repositories: gentoo crossdev_overlay finnish seden sunrise kde gentoo-zh Overlay_manage_priorities arduino nikos_gentoo_overlay temp_overlay
Installed sets: @world_sets
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=core2 -mcx16 -msahf -msse4.1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=core2"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -march=core2 -mcx16 -msahf -msse4.1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=core2"
DISTDIR="/mnt/harddisk/portage/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build=y --nospinner --oneshot"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles news parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms sign strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://trumpetti.atm.tut.fi/gentoo/ ftp://mirror.mdfnet.se/gentoo http://mirror.mdfnet.se/gentoo http://mirror.yandex.ru/gentoo-distfiles/ ftp://mirror.yandex.ru/gentoo-distfiles/"
LANG="fi_FI.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS=""
MAKEOPTS="-j4"
PKGDIR="/mnt/harddisk/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/mnt/harddisk/portage/build"
PORTDIR="/mnt/harddisk/portage/tree"
PORTDIR_OVERLAY="/mnt/harddisk/portage/overlays/crossdev /mnt/harddisk/portage/layman/finnish /mnt/harddisk/portage/layman/seden /mnt/harddisk/portage/layman/sunrise /mnt/harddisk/portage/layman/kde /mnt/harddisk/portage/layman/gentoo-zh /mnt/harddisk/portage/overlays/manage /mnt/harddisk/portage/overlays/arduino /mnt/harddisk/portage/overlays/niko-git /mnt/harddisk/portage/overlays/temp"
SYNC="rsync://192.168.1.50/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus declarative dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif gpm iconv ipv6 jpeg kde kipi lcms ldap libnotify mad mmx mng modules mp3 mp4 mpeg mudflap multilib ncurses networkmanager nls nptl ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds pppd pulseaudio qt3support qt4 readline sdl semantic-desktop session spell sse sse2 ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vorbis wxwidgets x264 xcb xcomposite xinerama xml xscreensaver xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" PHP_TARGETS="php5-3" PYTHON_TARGETS="python3_2 python2_7" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="2.7 3.2"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Brian Dolbec (RETIRED) gentoo-dev 2012-09-10 01:53:32 UTC
Actually it was portage that threw the exception, not equery directly.

What overlays do you have installed?  What is the sync time for your last emerge --sync?

Does it throw the exception if you do not include the -a parameter?  If not that would indicate a bad *DEPEND string in an ebuild in one of your overlays (more likely).  These types of errors should be caught before changes are commited to the the official tree.

It looks like the ebuild in question is missing spaces separating the ( ) and the dep inside.

psyco? (dev-python/psyco)

should be:

psyco? ( dev-python/psyco )
Comment 2 Niko Böckerman 2012-09-10 04:34:21 UTC
Repositories:

gentoo
    location: /mnt/harddisk/portage/tree
    sync: rsync://192.168.1.50/gentoo-portage
    priority: -1000

crossdev_overlay
    location: /mnt/harddisk/portage/overlays/crossdev
    masters: gentoo
    priority: 0

finnish
    location: /mnt/harddisk/portage/layman/finnish
    masters: gentoo
    priority: 1

seden
    location: /mnt/harddisk/portage/layman/seden
    masters: gentoo
    priority: 2

sunrise
    location: /mnt/harddisk/portage/layman/sunrise
    masters: gentoo
    priority: 3

kde
    location: /mnt/harddisk/portage/layman/kde
    masters: gentoo
    priority: 4

gentoo-zh
    location: /mnt/harddisk/portage/layman/gentoo-zh
    masters: gentoo
    priority: 5

Overlay_manage_priorities
    location: /mnt/harddisk/portage/overlays/manage
    masters: gentoo
    priority: 6

arduino
    location: /mnt/harddisk/portage/overlays/arduino
    masters: gentoo
    priority: 7

nikos_gentoo_overlay
    location: /mnt/harddisk/portage/overlays/niko-git
    masters: gentoo
    priority: 8

temp_overlay
    location: /mnt/harddisk/portage/overlays/temp
    masters: gentoo
    priority: 9


Timestamp of tree: Sun, 09 Sep 2012 17:45:01 +0000


I managed locate that depend string to come from gentoo-zh overlay and from portage-cdb-0.0.2.ebuild. So that error seems to originate from invalid depend string.

But shouldn't the equery command still survive from that kind of error and not crash completely?
Comment 3 Brian Dolbec (RETIRED) gentoo-dev 2012-09-10 06:45:50 UTC
Yeah, I think it probably should.  I've added some code to trap that error and hopefully print some decent debug info to stderr which should make it easier to know the offending ebuild.  I need to do some testing before committing it, but is too late for me now...
Comment 4 Brian Dolbec (RETIRED) gentoo-dev 2022-07-12 01:09:08 UTC
I am unable to reproduce this error with current code and current gentoo ebuild tree.