Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 286431 - x11-wm/compiz-0.8.2-r3: compiz-manager: too many arguments
Summary: x11-wm/compiz-0.8.2-r3: compiz-manager: too many arguments
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Desktop-Effects herd
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-25 17:22 UTC by Evert
Modified: 2009-10-28 11:24 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 Evert 2009-09-25 17:22:35 UTC
I found a bug in /usr/bin/compiz-manager. When I start compiz-manager, it complains about too many arguments in line 230.
This is because in line 225, TEXTURE_LIMIT is initialized but gets the values from both screen 0 and screen 1 since I have two screens (:0.0 and :0.1).

$ glxinfo -l | grep GL_MAX_TEXTURE_SIZE | sed 's/.*=[^0-9]//g'
4096
4096

This bug can be solved by adding the "-m1" option to grep or simply using a "|head -n 1" which might be more portable:

$ glxinfo -l | grep -m1 GL_MAX_TEXTURE_SIZE | sed 's/.*=[^0-9]//g'
4096

$ glxinfo -l | grep GL_MAX_TEXTURE_SIZE | head -n 1 | sed 's/.*=[^0-9]//g'
4096

so line 225 should read something like
TEXTURE_LIMIT=$(glxinfo -l | grep -m1 GL_MAX_TEXTURE_SIZE | sed 's/.*=[^0-9]//g')
or
TEXTURE_LIMIT=$(glxinfo -l | grep GL_MAX_TEXTURE_SIZE | head -n 1 | sed 's/.*=[^0-9]//g')

This way, the bug is solved.

Reproducible: Always

Steps to Reproduce:
1. configure X with 2 screens (:0.0 and :0.1)
2. compiz-manager

Actual Results:  
$ compiz-manager 
Checking for Xgl: not present. 
Detected PCI ID for VGA: 02:00.0 0300: 10de:0326 (rev a1) (prog-if 00 [VGA controller])
Checking for texture_from_pixmap: present. 
Checking for non power of two support: present. 
Checking for Composite extension: present. 
Comparing resolution (1920x1080
800x600) to maximum 3D texture size (4096
4096): ./compiz-manager: line 230: [: too many arguments
./compiz-manager: line 230: [: too many arguments
Passed.
Checking for nVidia: present. 
Checking for FBConfig: present. 
Checking for Xgl: not present. 
Starting gtk-window-decorator

Expected Results:  
$ compiz-manager 
Checking for Xgl: not present. 
Detected PCI ID for VGA: 02:00.0 0300: 10de:0326 (rev a1) (prog-if 00 [VGA controller])
Checking for texture_from_pixmap: present. 
Checking for non power of two support: present. 
Checking for Composite extension: present. 
Comparing resolution (1920x1080
800x600) to maximum 3D texture size (4096): Passed.
Checking for nVidia: present. 
Checking for FBConfig: present. 
Checking for Xgl: not present. 
Starting gtk-window-decorator

$ emerge --info
Portage 2.1.6.13 (default/linux/x86/2008.0/desktop, gcc-4.3.2, glibc-2.9_p20081201-r2, 2.6.30.7 i686)
=================================================================
System uname: Linux-2.6.30.7-i686-AMD_Athlon-tm-_XP_2600+-with-gentoo-1.12.11.1
Timestamp of tree: Fri, 25 Sep 2009 00:20:01 +0000
app-shells/bash:     4.0_p28
dev-java/java-config: 2.1.8-r1
dev-lang/python:     2.6.2-r1
dev-util/cmake:      2.6.4
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.7.9-r1, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.29
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/bind /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /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 /etc/udev/rules.d"
CXXFLAGS="-O2 -march=native -pipe"
DISTDIR="/data/linux/gentoo/distfiles"
FEATURES="distlocks fixpackages metadata-transfer parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="en_US.UTF8"
LDFLAGS="-Wl,-O1"
LINGUAS="en en_US en_GB nl de"
MAKEOPTS="-j2"
PKGDIR="/data/linux/gentoo/packages/amd_athlon-xp"
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="/compile"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.nl.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac acl acpi alsa ao apache2 apm berkdb bluetooth branding bzip2 cairo cdr cli cpudetection cracklib crypt cups dbus dri dts dvb dvd dvdr dvdread eds emboss encode esd evo exif fam ffmpeg firefox flac fortran gdbm gif gnome gpm gstreamer gtk hal iconv icu imlib ipv6 isdnlog java jpeg latex ldap libnotify libsamplerate mad mikmod mmx mng modules mozilla mp3 mp4 mpeg mplayer mudflap ncurses nls nptl nptlonly nsplugin ogg opengl openmp pam pcre pdf perl png ppds pppd python qt qt3 qt3support qt4 quicktime readline reflection samba sdl session sndfile sni spell spl sse ssl startup-notification svg sysfs tcpd theora thunar tiff truetype unicode usb v4l v4l2 vcd vhosts vorbis win32codecs wmf x264 x86 xinerama xml xorg xulrunner xv xvid xvmc zlib" ALSA_CARDS="intel8x0" 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 auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US en_GB nl de" USERLAND="GNU" VIDEO_CARDS="vesa fbdev v4l nv nvidia"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Romain Perier (RETIRED) gentoo-dev 2009-10-09 15:59:37 UTC
In my opinion, I prefer add -m1 option to grep, because head -n 1 increase the number of syscalls (+1 pipe(), +2 dup(), +1 fork(), + 1 execlp()/execvp() )
Comment 2 Evert 2009-10-10 00:55:49 UTC
In that case we could even eliminate grep completely, and let sed do all the work and only one pipe is left:

$ glxinfo -l | sed -nre '/^ *GL_MAX_TEXTURE_SIZE *= */{s///p;q}'
4096

;-)
Comment 3 Romain Perier (RETIRED) gentoo-dev 2009-10-10 09:14:18 UTC
(In reply to comment #2)
> In that case we could even eliminate grep completely, and let sed do all the
> work and only one pipe is left:
> 
> $ glxinfo -l | sed -nre '/^ *GL_MAX_TEXTURE_SIZE *= */{s///p;q}'
> 4096
> 
> ;-)
> 

hey, indeed that's nice :)

@jmbsvicetto: your opinion ?
Comment 4 Romain Perier (RETIRED) gentoo-dev 2009-10-15 16:31:12 UTC
+*compiz-0.8.4 (15 Oct 2009)
+
+  15 Oct 2009; Romain Perier <mrpouet@gentoo.org>
+  +compiz-0.8.4.ebuild, files/compiz-manager:
+  Version bump. Many bugfixes, 2 new plugins, Ported KDE4 window decorator
+  to KDE 4.3. Fix bug #286431 thanks to Evert.

Fixed in the main tree, thanks for reporting and for your comment ;)
Comment 5 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2009-10-28 11:24:00 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > In that case we could even eliminate grep completely, and let sed do all the
> > work and only one pipe is left:
> > 
> > $ glxinfo -l | sed -nre '/^ *GL_MAX_TEXTURE_SIZE *= */{s///p;q}'
> > 4096
> > 
> > ;-)
> > 
> 
> hey, indeed that's nice :)
> 
> @jmbsvicetto: your opinion ?

Looks good. Thanks for taking care of this.