Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 508232 - net-misc/spice-gtk net-misc/vino and net-libs/gtk-vnc with x11-libs/cairo[xlib-xcb] - remote screen display corruption
Summary: net-misc/spice-gtk net-misc/vino and net-libs/gtk-vnc with x11-libs/cairo[xli...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Matt Turner
URL:
Whiteboard:
Keywords:
: 553958 (view as bug list)
Depends on: 441878
Blocks:
  Show dependency tree
 
Reported: 2014-04-20 12:57 UTC by INODE64 Sistemas
Modified: 2017-02-26 00:30 UTC (History)
7 users (show)

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


Attachments
vinagre.jpg (cairo.jpg,39.93 KB, image/jpeg)
2014-04-22 18:35 UTC, INODE64 Sistemas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description INODE64 Sistemas 2014-04-20 12:57:03 UTC
The enable xlib-xcb in x11-libs/cairo
All applications (vino, spice-gtk, gtk-vnc, etc...) only show the first lines of screen and halt, no mouse and keyboard events, but the events are send.

This error fix after moths the check flags and change of versions :-(

Reproducible: Always
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2014-04-22 14:14:46 UTC
1) Please post your `emerge --info x11-libs/cairo' output in a comment.
2) When started from a terminal, do these programs output more information that might be helpful?
Comment 2 INODE64 Sistemas 2014-04-22 18:18:43 UTC
Portage 2.2.8-r1 (default/linux/amd64/13.0/desktop/gnome, gcc-4.7.3, glibc-2.17, 3.12.13-gentoo x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.12.13-gentoo-x86_64-AMD_A8-5600K_APU_with_Radeon-tm-_HD_Graphics-with-gentoo-2.2
KiB Mem:     3939328 total,    723452 free
KiB Swap:    2000088 total,   1972188 free
Timestamp of tree: Mon, 14 Apr 2014 07:00:01 +0000
ld GNU ld (GNU Binutils) 2.23.2
distcc 3.1 x86_64-pc-linux-gnu [enabled]
ccache version 3.1.9 [enabled]
app-shells/bash:          4.2_p45
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.5-r3, 3.3.3
dev-util/ccache:          3.1.9-r3
dev-util/cmake:           2.8.12.2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.10.3, 1.11.6, 1.13.4
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.7.3-r1
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo inode64
Installed sets: @system
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=k8 -pipe -msahf -mcx16"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /lib/modules /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.4/ext-active/ /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/php/cli-php5.5/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"
CXXFLAGS="-O2 -march=k8 -pipe -msahf -mcx16"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg ccache config-protect-if-modified distcc distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG=""
LC_ALL="es_ES.utf8"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--delete-during"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
USE="3dnow 3dnowext X \ a52 aac acl acpi alsa amd64 amr apache2 apm asf avahi bluetooth branding browserplugin bzip2 bzuo2 cairo caps cdda cgi cli colord consolekit cracklib crypt cups curl cxx dbus dlloader dmx dri dts dvb dvd dvi emboss encode ethereal evo exif faac faad fam fame ffmpeg fftw firefox flac fontconfig foomaticdb gdu gimp glitz gmp gnome gnome-keyring gnome-online-accounts gpm gstreamer gtk gtk3 iconv imap introspection ithreads java5 javascript jbig jpeg lame lcms libnotify libsamplerate libsecret libvisual live llvm lzo lzw-tiff mad maildir matroska mjpeg mmap mmx mmxext modules mono mp3 mp4 mpeg mpeg2 mpi mplayer multilib nautilus ncurses net nfs nls nopie nossp nptl nsplugin ogg oggvorbis openal opengl openmp pam pango pcre pdf png policykit ppds print pulseaudio qt3support quicktime raw readline real samba scanner session smp sndfile snmp socialweb speex spell sse sse2 ssl startup-notification svg system-sqlite theora threads tiff truetype udev udisks unicode upower usb v4l v4l2 vdpau vhosts vorbis webkit win32codes wma123 wxwidgets wxwindows x264 xattr xcb xinerama xulrunner xv xvid xvmc zlib" ABI_X86="64" ALSA_CARDS="hda-intel" APACHE2_MODULES="cgi cgid 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" APACHE2_MPMS="worker" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" 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 ublox ubx" INPUT_DEVICES="keyboard mouse evdev joystick synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="pdfimport presenter-console presenter-minimizer" LINGUAS="es_ES es" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-3 php5-2 php5-4" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python3_3 python2_7" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby20" SANE_BACKENDS="genesys net" USERLAND="GNU" VIDEO_CARDS="v4l radeon r600 nouveau modesetting" 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, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, SYNC, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

x11-libs/cairo-1.12.16 was built with the following:
USE="X glib opengl openvg svg xcb (-aqua) -debug -directfb -doc (-drm) (-gallium) (-gles2) -legacy-drivers (-qt4) -static-libs -valgrind -xlib-xcb"
CFLAGS="-O2 -march=k8 -pipe"
CXXFLAGS="-O2 -march=k8 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
Comment 3 INODE64 Sistemas 2014-04-22 18:35:18 UTC
Created attachment 375496 [details]
vinagre.jpg

Example of screen capture. use vinagre, connect to vnc 
Only show the first lines.
Comment 4 Alexandre Rostovtsev (RETIRED) gentoo-dev 2014-05-02 20:40:59 UTC
Please try to build cairo with USE=xlib-xcb and see if that fixes the problem.
Comment 5 Alexandre Rostovtsev (RETIRED) gentoo-dev 2014-05-02 20:42:15 UTC
ah, I apologize, I misunderstood your comments.
Comment 6 Greg Turner 2015-01-01 07:00:23 UTC
Spice looks like this for me across most implementations expect spicec, like Francisco.  I have USE=xlib-xcb set.
Comment 7 Greg Turner 2015-01-01 07:05:04 UTC
I also happen to have a radeon on an AMD cpu, btw... perhaps some kind of gcc flags thing?  I'll try emerging spice-gtk and some deps with -march=i686 and see what happens....  may take a while :(
Comment 8 INODE64 Sistemas 2015-01-01 08:44:06 UTC
I've checked on multiple computers with AMD or NVIDIA and problem is the same . In other distributions is not set xlib-xcb , Fedora and Debian, for instance.
Comment 9 Greg Turner 2015-01-02 09:11:19 UTC
Well, I'll be damned, you're right.  Disabling the use flag fixes it.

It seems, then, that the problem is identified and fixable, in which case, the status-quo seems pretty unacceptable.  Possible solutions:

o make -xlib-xcb the default in cairo -- but it seems this causes problems for other packages, however (at least, so the ebuild says), and, anyhow, defaults are optional, what if someone changes it?  So I don't like this one.

o make spice-gtk -> cairo[-xlib-xcb] dependencies, or similar as appropriate in the various affected places.

o make no hard dependency, but ewarn damn loudly about this during the various affected ebuilds' pkg_setup (best option, maybe, if it is believed that too many conflicts/incompatibilities will arise from any technocratically enforced solution).

o Implement one of various "thermonuclear" options: Side-by-side library building with corresponding hacks to maintain in affected dependent ebuilds, a cairo-xlib-xcb package, statically linked per-package libcairo, eselect cairo-xlib, etc....  All of which are pretty terrible for Gentoo devs but likely fantastic for end-users (until it breaks, which it surely will, over and over and over...)

o Find the underlying problem with lib-xcb and fix it. 

P.S., I lost track of it but upstream does have a bug for this.
Comment 10 INODE64 Sistemas 2015-01-02 10:04:18 UTC
I searched around the portage and only recommend using xlib-xcb in nx-3.5.0.*

net-misc/nx/nx-3.5.0.24.ebuild:DOC_CONTENTS="If you get problems with rendering gtk+ apps, enable the xlib-xcb
net-misc/nx/nx-3.5.0.27.ebuild:DOC_CONTENTS="If you get problems with rendering gtk+ apps, enable the xlib-xcb
net-misc/nx/nx-3.5.0.28.ebuild:DOC_CONTENTS="If you get problems with rendering gtk+ apps, enable the xlib-xcb
Comment 11 Rémi Cardona (RETIRED) gentoo-dev 2015-01-02 11:30:50 UTC
Some background may be necessary, if you'll allow me.

Cairo has been around for the better part of a decade, and as such has been using libX11 since its beginnings. When XCB (in the form of libxcb) showed up, cairo was adapted with a new backend (USE=xcb in our ebuild).

However this meant that this backend was only used by applications that used libxcb too. XCB has been around for a long time too and only a handful of applications use libxcb only.

So, in order to speed up conversion, X devs modified libX11 1) to use libxcb internally 2) to allow applications to use both at the same time (as can be seen in /usr/include/X11/Xlib-xcb.h)

In cairo, there are now 3 backends that can talk to an X server: the Xlib one, the xcb one and the xcb-xlib. That third one uses the connection bits of the Xlib backend but then uses the xcb backend for all rendering, allowing the xcb backend to be tested by applications not (yet) using xcb.

Back to present day: no one is working on cairo's xcb backend, so the xlib-xcb backend (which shares almost all its code) is bit-rotting. The easy solution is to just turn off this USE flag (which is the default). It _is_ a bug in cairo, one that should be reported, but I'm afraid it'll get little, if at all, attention.

If anything in Gentoo. requires cairo[xlib-xcb] then this is a real issue which should be reported here.

Cheers
Comment 12 Reto Gantenbein (ganto) 2015-02-24 12:54:50 UTC
After a long time living with the currupted video output I took my time today to nail down the issue and finally found this bug report. Wouldn't it be possible to add '>=x11-libs/cairo-1.2[-xlib-xcb]' to the spice-gtk dependencies?
Comment 13 Tiziano Müller (RETIRED) gentoo-dev 2015-02-25 07:17:55 UTC
@ganto: thanks a lot for tracking this down.

As far as I remember it is not the first time that enabling the xlib-xcb USE flag on cairo breaks something, furthermore cairo upstream has the configure flag disabled by default for a good reason. I would therefore recommend to either remove that flag completely or at least add a warning to cairo instead.
Comment 14 Reto Gantenbein (ganto) 2015-02-25 14:57:34 UTC
Actually, I only track it down for myself ;-)  The solution was already provided here.

I originally enabled the xlib-xcb USE flag for myself, because from the description of it, it sounds reasonable to use. I wasn't aware of the bad maintenance state described above. Therefore a warning would definitely be helpful.
Comment 15 Chí-Thanh Christopher Nguyễn gentoo-dev 2015-02-25 15:04:38 UTC
xlib-xcb flag was introduced because of freenx problems which are worked around by this flag, bug 441878.
Comment 16 Matthias Maier gentoo-dev 2015-08-22 20:35:07 UTC
*** Bug 553958 has been marked as a duplicate of this bug. ***
Comment 17 Matthias Maier gentoo-dev 2015-08-22 20:38:41 UTC
Can we at least add a big warning in the use flag description?
Something like "Only enable this if you need to, see bug #...")

The current one is not that terribly descriptive:

 xlib-xcb    : Use XCB renderer backend for acceleration over xlib

(Is this an "instead of xlib"? Or does "for acceleration" imply that -xlib-xcb
does not provide any acceleration?)
Comment 18 Chí-Thanh Christopher Nguyễn gentoo-dev 2015-08-24 12:54:12 UTC
I think the USE flag description is accurate. xcb is used for acceleration instead of xlib with that flag enabled.

If it doesn't cause screen corruption the xlib-xcb backend is actually preferable I think, as it is more modern and better performing.

Because it may solve or create screen corruption issues, it remains disabled by default. Adding a warning about this would be fine with me.
Comment 19 Chí-Thanh Christopher Nguyễn gentoo-dev 2015-08-24 13:32:06 UTC
A statement about possible display corruption has been added to the xlib-xcb flag description:
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0b666ffb3ca47f25b3f6ea892a50861305bea4f8
Comment 20 Matt Turner gentoo-dev 2017-02-26 00:30:32 UTC
USE=xlib-xcb has been removed/package.use.mask'd.

commit da01c57e7db19e4aeeab5877ca15d873acbaed75
Author: Matt Turner <mattst88@gentoo.org>
Date:   Sat Feb 25 16:12:55 2017 -0800

    profiles: USE-mask xlib-xcb on x11-libs/cairo.

commit 7de1e4b63e45169100547609744aa4cd32ccdfb4
Author: Matt Turner <mattst88@gentoo.org>
Date:   Sat Feb 25 16:10:50 2017 -0800

    x11-libs/cairo: Drop USE=xlib-xcb flag from unstable versions.