Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 355623 - app-portage/eix-0.22.5 is broken: 'regcomp(xxx(): Unmatched ( or \('
Summary: app-portage/eix-0.22.5 is broken: 'regcomp(xxx(): Unmatched ( or \('
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Martin Väth
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-19 21:07 UTC by Tom Lloyd
Modified: 2011-03-12 04:42 UTC (History)
1 user (show)

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


Attachments
strace of eix 0.22.5 running and failing (eix-0.22.5-fail-strace,38.15 KB, text/plain)
2011-02-19 23:05 UTC, Tom Lloyd
Details
strace of eix 0.20.5 running and hanging (eix-0.20.5-fail-strace,272.40 KB, text/plain)
2011-02-19 23:06 UTC, Tom Lloyd
Details
Patch experiment for a compiler error (no_auto_ptr.patch,2.02 KB, patch)
2011-02-21 23:20 UTC, Martin Väth
Details | Diff
Fix of previous patch (no_auto_ptr.patch,1.46 KB, patch)
2011-02-21 23:30 UTC, Martin Väth
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Lloyd 2011-02-19 21:07:27 UTC
Recently eix has stopped functioning properly.  Whenever I run it, even invoked simply as 'eix' with no arguments, it simply spits the following error message at me:

regcomp(xxx(): Unmatched ( or \(

Where xxx is a series of three seemingly arbitrary, and not necessarily printable, characters which change each time I run it, even with the same arguments.

eix-0.19.2 appears to be unaffected by this.


Reproducible: Always

Steps to Reproduce:
Run eix with or without arguments



Portage 2.1.9.25 (uclibc/ppc/hardened, gcc-3.4.6, uclibc-0.9.30.1-r1, 2.6.28-hardened-r9-muttley-3-wifi ppc)
=================================================================
System uname: Linux-2.6.28-hardened-r9-muttley-3-wifi-ppc-G2_LE-with-gentoo-1.12.14
Timestamp of tree: Wed, 16 Feb 2011 21:45:01 +0000
distcc 3.1 powerpc-gentoo-linux-uclibc [enabled]
ccache version 2.4 [enabled]
app-shells/bash:     4.1_p9
dev-lang/python:     2.4.6, 2.5.4-r3, 2.6.6-r1, 3.1.2-r4
dev-util/ccache:     2.4-r7
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 1.12.14-r1
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.65-r1
sys-devel/automake:  1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       3.4.6-r2, 4.3.4
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.30-r1 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="ppc"
ACCEPT_LICENSE="* -@EULA"
CBUILD="powerpc-gentoo-linux-uclibc"
CFLAGS="-O2 -mcpu=603e -pipe"
CHOST="powerpc-gentoo-linux-uclibc"
CONFIG_PROTECT="/etc /usr/share/openvpn/easy-rsa /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/php/apache2-php5.2/ext-active/ /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5.2/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5.2/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -mcpu=603e -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs ccache distcc distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-z,relro"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/mnt/spare"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /var/lib/layman"
SYNC="rsync://splig/gentoo-portage"
USE="alsa apache2 bzip2 cgi cli cracklib crypt cxx dri embedded fastcgi hardened ipv6 modules mudflap mysql ncurses offensive openmp pcre perl php pic ppc python quotas readline samba session sni sqlite ssl ssp suhosin syslog tcpd uclibc uclibc-compat unicode xorg zlib" 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="alias auth_basic authn_alias authn_anon authn_default authn_file authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache 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 proxy proxy_http dav dav_fs auth_digest" APACHE2_MPMS="prefork" CAMERAS="sq905" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="uclibc" 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" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="dummy fbdev v4l" 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" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Tom Lloyd 2011-02-19 23:05:46 UTC
Created attachment 263105 [details]
strace of eix 0.22.5 running and failing
Comment 2 Tom Lloyd 2011-02-19 23:06:49 UTC
Created attachment 263107 [details]
strace of eix 0.20.5 running and hanging

Interestingly, eix-0.20.5 fails too, but in a different way: it just hangs.  I've added straces of both cases if they're useful.
Comment 3 Martin Väth 2011-02-20 09:31:59 UTC
Maybe your eix cache is broken?  Please retry after  eix-update.

If this does not help, please try the following:

1. Try whether the problem occurs also when you temporarily rename your local
/etc/portage/*
files. In this case, please find out (e.g. by binary search)
which file is responsible (if possible, even which line of the file
is responsible) and attach it.

2. If you use overlays, try whether the problem is related with them:
Does the problem occur also after 

eix-update --exclude-overlay /usr/portage

(replace /usr/portage by the path to your portage directory if it differs)?
If yes, please try to find a minimal eix cache file for which your problem
occurs, i.e. call

PORTDIR_OVERLAY="..." eix-update --exclude-overlay /usr/portage

where "..." contains as few of your overlays as is necessary to
produce the error.
Then please attach the produced cache file /var/cache/eix
Comment 4 Martin Väth 2011-02-20 09:34:17 UTC
(In reply to comment #3)
In the first sentence of 1. I meant the opposite:

> 1. Try whether the problem *vanishes* when you temporarily rename [...]
Comment 5 Martin Väth 2011-02-20 10:19:16 UTC
Please try also instead of empty argument whether eix -zs works.
Comment 6 Tom Lloyd 2011-02-20 16:47:28 UTC
OK, I've just remerged eix-0.22.5:

* Moving /etc/portage to /etc/portage.bak has no effect.

* Excluding repositories from eix-update has no effect.

* Running 'eix -zs some_argument' has no effect.

* Running 'eix -zs' exhibits the same hanging behaviour as eix-0.20.5.
Comment 7 Martin Väth 2011-02-21 23:20:02 UTC
Created attachment 263381 [details, diff]
Patch experiment for a compiler error

(In reply to comment #6)

> * Running 'eix -zs some_argument' has no effect.

What does this mean? Everything works as it should in this case?
Or does it always print "no matches" even if "eix -zs eix"
should print matches?

> * Running 'eix -zs' exhibits the same hanging behaviour as eix-0.20.5.

This is a very bad sign which hints to some memory corruption _somewhere_;
it might even be a compiler bug. Since I cannot reproduce the problem here,
I see almost no chance that I can debug it.

Anyway, I attach a patch which does some things different (avoiding auto_ptr
and a complicated casting in connection with Regex); so if it is a compiler
bug, it might solve something.
Comment 8 Martin Väth 2011-02-21 23:30:27 UTC
Created attachment 263383 [details, diff]
Fix of previous patch

Removed Patch of ChangeLog which was added by mistake
Comment 9 Tom Lloyd 2011-02-21 23:52:59 UTC
(In reply to comment #7)
> > * Running 'eix -zs some_argument' has no effect.
> What does this mean?

I mean that 'eix -zs some_argument' behaves the same as 'eix some_argument', ie. it fails with the regcomp error.


Thanks for the patch.  Unfortunately it doesn't appear to make any difference: I still get the same regcomp error as before.

I have static IP, I can give you a login to my box if necessary.  Usually when something breaks on this machine it's uClibc to blame, either directly by lacking features or indirectly by software authors making invalid assumptions.  regcomp is from libc, right?
Comment 10 Martin Väth 2011-02-22 20:00:19 UTC
(In reply to comment #9)
> I mean that 'eix -zs some_argument' behaves the same as
> 'eix some_argument', ie. it fails with the regcomp error.

This is very strange, since regcomp is then only called in one place
which is unchanged since eix-0.15.something.
It looks more and more like a memory corruption somewhere else...

> I can give you a login to my box if necessary.

I am afraid that without this, I will not be able to debug this problem.
More on private mali.

> it's uClibc to blame, either directly by lacking features
> or indirectly by software authors making invalid assumptions. 

I was rather carefully to use only POSIX. It is probably a bug -
either in compiler or some library or in eix.

> regcomp is from libc, right?

The problem is not regcomp: Obviously, when it is called, there
is already some garbage in memory.
Comment 11 Martin Väth 2011-02-23 22:30:26 UTC
Thanks for letting me debug.
I finally found the bug, although I do not understand it:

There is a variable "argreader" of type std::list, and a function got the
iterators argreader.begin() and argreader.end() as parameter.
However, although argreader is not accessed in a writable manner in this
function, it seems that the "true" value of argreader.end() changes within
the function causing the loop within the function to never reach the
originally passed value of argreader.end().
(Hence, the loop gets infinite which caused eix to interpret random memory
content as passed arguments).

The fix is of course to access argreader.end() only dynamically, although
this should not be necessary according to any C++ standard which I know.

The corresponding fix is now in eix svn trunk (>=eix-0.22.8).
Comment 12 Tom Lloyd 2011-02-23 22:47:29 UTC
Excellent, thanks for taking the time to do this!  How long does it normally take for the SVN trunk to reach Portage?
Comment 13 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-03-12 04:42:45 UTC
+*eix-0.22.8 (12 Mar 2011)
+
+  12 Mar 2011; Jeremy Olexa <darkside@gentoo.org> +eix-0.22.8.ebuild:
+  Version bump from upstream, fixes bugs 354071, 355623, 353562, 353705