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

Bug 393439

Summary: media-video/vlc-1.1.12 - gui doesn't work: [0x19ee640] qt4 interface error: Xlib not initialized for threads
Product: Gentoo Linux Reporter: Emmanuel Andry <eandry>
Component: Current packagesAssignee: Alexis Ballier <aballier>
Status: RESOLVED FIXED    
Severity: major CC: media-video
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Vlc strace

Description Emmanuel Andry 2011-12-06 20:31:49 UTC
When launching vlc, no gui appears.

$ LC_ALL="C" vlc
VLC media player 1.1.12 The Luggage (revision exported)
Blocked: call to unsetenv("DBUS_ACTIVATION_ADDRESS")
Blocked: call to unsetenv("DBUS_ACTIVATION_BUS_TYPE")
[0x16d4150] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
../../../include/vlc_xlib.h:46:vlc_xlib_init: Xlib not initialized for threads.
This process is probably using LibVLC incorrectly.
Pass "--no-xlib" to libvlc_new() to fix this.
[0x19ee640] qt4 interface error: Xlib not initialized for threads
Remote control interface initialized. Type `help' for help.


$ emerge --info vlc
Portage 2.1.10.39 (default/linux/amd64/10.0/desktop/gnome, gcc-4.6.2, glibc-2.14.1-r1, 3.1.4-gentoo x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.1.4-gentoo-x86_64-Intel-R-_Core-TM-_i7-2630QM_CPU_@_2.00GHz-with-gentoo-2.1
Timestamp of tree: Tue, 06 Dec 2011 19:45:01 +0000
app-shells/bash:          4.2_p20
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.2-r3, 3.2.2
dev-util/cmake:           2.8.6-r4
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1
sys-apps/openrc:          0.9.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.1-r1
sys-devel/binutils:       2.22
sys-devel/gcc:            4.6.2
sys-devel/gcc-config:     1.5-r2
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 2.6.39 (virtual/os-headers)
sys-libs/glibc:           2.14.1-r1
Repositories: gentoo
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA googleearth Broadcom PUEL dlj-1.1 skype-eula"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -ggdb -march=native -mtune=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -ggdb -march=native -mtune=native"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build=n --with-bdeps=y --keep-going"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/ ftp://mirrors.linuxant.fr/distfiles.gentoo.org/ ftp://mirror.ovh.net/gentoo-distfiles/ ftp://mirror.netcologne.de/gentoo/ ftp://mirror.opteamax.de/gentoo/ ftp://ftp.halifax.rwth-aachen.de/gentoo/ ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo ftp://ftp.join.uni-muenster.de/pub/linux/distributions/gentoo http://mirror.leaseweb.com/gentoo/ http://ftp.snt.utwente.nl/pub/os/linux/gentoo ftp://ftp.df.lth.se/pub/gentoo/ http://mirror.switch.ch/ftp/mirror/gentoo/ ftp://mirror.switch.ch/mirror/gentoo/ http://mirror.bytemark.co.uk/gentoo/ ftp://gentoo.virginmedia.com/sites/gentoo ftp://mirror.mcs.anl.gov/pub/gentoo/ http://www.cyberuse.com/gentoo/ ftp://distro.ibiblio.org/pub/linux/distributions/gentoo/ ftp://ftp.ussg.iu.edu/pub/linux/gentoo ftp://lug.mtu.edu/gentoo/ ftp://gentoo.mirrors.pair.com/ http://gentoo.llarian.net/ ftp://ftp.ucsb.edu/pub/mirrors/linux/gentoo/ ftp://ftp.lug.udel.edu/pub/gentoo/ ftp://mirror.its.uidaho.edu/gentoo/ http://gentoo.cs.uni.edu/ ftp://ftp.wallawalla.edu/pub/mirrors/ftp.gentoo.org"
LANG="fr_FR.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="fr"
MAKEOPTS="-j9"
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="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.fr.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi aes alsa amd64 amr apng archive audit autoipd avahi avx bash-completion berkdb bittorrent bluetooth branding bzip2 cairo call caps caps-ng cdda cddb cdio cdr cgroup chm cleartype cli clutter colord colordiff consolekit cracklib cron crypt css cups curl cxx dbus desktopglobe dga dhcp dirac dlna dri dts dvd dvdr ebook eds embedded-fuseiso emboss encode epub equalizer evo exif extras faac faad facebook fam fat ffmpeg fftw firefox flac fluidsynth fontconfig fortran freetype fts3 fuse g3dvl gallium gbm gdbm gdm gdu geoip gif gimp gjs glamor gles gles2 gmp gnome gnome-keyring gnome-online-accounts gnutls gold gphoto2 gpm grilo gs gsm gstreamer gtk gtk3 hdmi hdri iconv icoutils icq id3tag idn imagemagick inotify ipv6 irc jabber java jbig jemalloc joystick jpeg jpeg2k ladspa laptop lcms ldap libcanberra libedit libkms libnl libnotify libsamplerate libv4l2 live llvm lm_sensors lzma lzo mad map matroska midi mikmod minizip mms mmx mmxext mng modules mp3 mp4 mpeg msn mtp mudflap multilib musepack musicbrainz nautilus ncurses network network-cron networkmanager nls nntp nptl nptlonly nsplugin nss ntp numa offensive ogg openal openexr opengl openmp openssl openvg optimized-qmake packagekit pam pango pcre pdf pdfimport physfs plymouth pm-utils pnat png policykit portaudio ppds pppd prelink pulseaudio qt3support qt4 quicktime rdesktop readline resolvconf rle rss rtmp rtsp samba schroedinger sdl secure-delete sendto session sip smp sna sndfile socialweb speex spell sse sse2 sse3 sse41 sse42 ssl ssse3 startup-notification stream strong-optimization suid svg symlink synaptics sysfs syslog system-sqlite taglib tcpd theora threads thumbnail tiff truetype udev unicode unlock-notify upnp usb utempter utp v4l vaapi vdpau vnc vorbis vp8 vpx wav wavpack webgl webm webp wifi windeco winetricks wps x264 xattr xcb xcomposite xinerama xml xmp xorg xosd xpm xps xscreensaver xulrunner xv xvid zip 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 stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" DRACUT_MODULES="plymouth 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" INPUT_DEVICES="evdev joystick synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="fr" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel nouveau" 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, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

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

media-video/vlc-1.1.12 was built with the following:
USE="X a52 aac alsa avahi cdda cddb dbus dirac dts dvd ffmpeg flac fluidsynth fontconfig gcrypt gme gnome gnutls id3tag libnotify libv4l2 live matroska mmx mp3 mpeg mtp (multilib) musepack ncurses nsplugin ogg opengl png pulseaudio qt4 rtsp samba schroedinger sdl speex sse stream svg taglib theora truetype udev upnp v4l vaapi vorbis x264 xcb xml xosd xv -aalib (-altivec) -atmo -bidi -dc1394 -debug -directfb -dvb -fbcon -ggi -httpd -ieee1394 -jack -kate -kde -libass -libcaca -libproxy -libtiger -libv4l -lirc -lua -modplug -optimisememory -oss -projectm -pvr -remoteosd -run-as-root -sdl-image -shine -shout -skins -sqlite (-svga) -twolame -vcdx -vlm (-win32codecs) -wma-fixed -zvbi"



Reproducible: Always
Comment 1 Alexis Ballier gentoo-dev 2011-12-07 11:40:55 UTC
This is gonna be annoying to debug... vlc has checks for Xlib's thread initialisation. XInitThread funtion shall be the first Xlib function called within vlc's process because vlc is multithreaded. Some libraries (like old versions of pulseaudio) which are not multithreaded call Xlib's functions without calling XInitThread. In its pulseaudio support, vlc calls XInitThread before going in pulseaudio stuff for example.

Now, the error you're seeing is exactly this, but for a yet undetermined library.

Could you try to trace the function/library calls of your failing vlc process please? Setting a breakpoint on some common Xlib function within gdb can help too.


CCing x11@, maybe they can help.
Comment 2 Emmanuel Andry 2011-12-07 20:31:20 UTC
Created attachment 295129 [details]
Vlc strace

Here's vlc strace. Hope this helps
Comment 3 Alexis Ballier gentoo-dev 2011-12-07 22:23:37 UTC
well, at least i cannot interpret the output of this trace :)


maybe better:
$ gdb vlc
(gdb) b XOpenDisplay
(gdb) run

Breakpoint 1, XOpenDisplay (display=0x0) at /var/tmp/portage/x11-libs/libX11-1.4.4/work/libX11-1.4.4/src/OpenDis.c:66
66	/var/tmp/portage/x11-libs/libX11-1.4.4/work/libX11-1.4.4/src/OpenDis.c: No such file or directory.
	in /var/tmp/portage/x11-libs/libX11-1.4.4/work/libX11-1.4.4/src/OpenDis.c

(gdb) bt

#0  XOpenDisplay (display=0x0) at /var/tmp/portage/x11-libs/libX11-1.4.4/work/libX11-1.4.4/src/OpenDis.c:66
#1  0x00007fffefcffda7 in Open (p_this=0x6cd698, isDialogProvider=false) at qt4.cpp:345



Now I see that XOpenDisplay has been called by Open in qt4.cpp, thus from the qt4 interface of vlc.
Comment 4 Emmanuel Andry 2011-12-08 20:18:18 UTC
Ok, but :

(gdb) b XOpenDisplay
Function "XOpenDisplay" not defined.
Make breakpoint pending on future shared library load? (y or [n])
Comment 5 Emmanuel Andry 2011-12-08 20:21:38 UTC
When saying yes :

Breakpoint 1 (XOpenDisplay) pending.
(gdb) run
Starting program: /usr/bin/vlc 
[Thread debugging using libthread_db enabled]
VLC media player 1.1.12 The Luggage (revision exported)
[New Thread 0x7fffcd9a6700 (LWP 27740)]
Blocked: call to unsetenv("DBUS_ACTIVATION_ADDRESS")
Blocked: call to unsetenv("DBUS_ACTIVATION_BUS_TYPE")
[New Thread 0x7fffcd8a5700 (LWP 27741)]
[New Thread 0x7fffcd7a4700 (LWP 27742)]

Breakpoint 1, XOpenDisplay (display=0x7fffffffef33 ":0")
    at /var/tmp/portage/x11-libs/libX11-1.4.4/work/libX11-1.4.4/src/OpenDis.c:66
66	/var/tmp/portage/x11-libs/libX11-1.4.4/work/libX11-1.4.4/src/OpenDis.c: Aucun fichier ou dossier de ce type.
	in /var/tmp/portage/x11-libs/libX11-1.4.4/work/libX11-1.4.4/src/OpenDis.c
Comment 6 Alexis Ballier gentoo-dev 2011-12-08 20:34:45 UTC
you should say yes, then compare:

(In reply to comment #5)
> Breakpoint 1, XOpenDisplay (display=0x7fffffffef33 ":0")
>     at
> /var/tmp/portage/x11-libs/libX11-1.4.4/work/libX11-1.4.4/src/OpenDis.c:66
> 66    /var/tmp/portage/x11-libs/libX11-1.4.4/work/libX11-1.4.4/src/OpenDis.c:
> Aucun fichier ou dossier de ce type.
>     in /var/tmp/portage/x11-libs/libX11-1.4.4/work/libX11-1.4.4/src/OpenDis.c

with:

(In reply to comment #3)
> Breakpoint 1, XOpenDisplay (display=0x0) at
> /var/tmp/portage/x11-libs/libX11-1.4.4/work/libX11-1.4.4/src/OpenDis.c:66
> 66    /var/tmp/portage/x11-libs/libX11-1.4.4/work/libX11-1.4.4/src/OpenDis.c:
> No such file or directory.
>     in /var/tmp/portage/x11-libs/libX11-1.4.4/work/libX11-1.4.4/src/OpenDis.c
> 
> (gdb) bt
> 
> #0  XOpenDisplay (display=0x0) at
> /var/tmp/portage/x11-libs/libX11-1.4.4/work/libX11-1.4.4/src/OpenDis.c:66
> #1  0x00007fffefcffda7 in Open (p_this=0x6cd698, isDialogProvider=false) at
> qt4.cpp:345
> 

the 'bt' tells you where it comes from


(removing x11@, shouldnt be needed to spam them now)
Comment 7 Emmanuel Andry 2011-12-08 20:38:22 UTC
Sorry, I forgot the bt !

(gdb) bt
#0  XOpenDisplay (display=0x7fffffffef33 ":0")
    at /var/tmp/portage/x11-libs/libX11-1.4.4/work/libX11-1.4.4/src/OpenDis.c:66
#1  0x00007fffe2330251 in xosd_create (number_lines=1) at xosd.c:715
#2  0x00007fffe25349c3 in Open (p_this=0x6e56c0) at xosd.c:128
#3  0x0000003691a7ef75 in module_need (p_this=<optimized out>, 
    psz_capability=0x3691a9ac87 "interface", psz_name=<optimized out>, 
    b_strict=true) at modules/modules.c:559
#4  0x0000003691a3051d in intf_Create (p_this=<optimized out>, 
    psz_module=<optimized out>) at interface/interface.c:128
#5  0x0000003691a20852 in libvlc_InternalInit (p_libvlc=0x605120, i_argc=2, 
    ppsz_argv=0x7fffffffdc60) at libvlc.c:888
#6  0x0000003692207f02 in libvlc_new (argc=1, argv=<optimized out>)
    at control/core.c:58
#7  0x0000000000401290 in main (i_argc=1, ppsz_argv=0x7fffffffdeb8)
    at vlc.c:181
Comment 8 Alexis Ballier gentoo-dev 2011-12-09 19:58:56 UTC
thanks, this should be fixed in 1.1.12-r1. please tell me if the problem disapears

(if it does not, please attach a new backtrace :) )
Comment 9 Emmanuel Andry 2011-12-09 21:36:33 UTC
It works ! You're my hero !
But what was the problem ( and the fix ) ?
Comment 10 Alexis Ballier gentoo-dev 2011-12-09 22:32:24 UTC
(In reply to comment #9)
> It works ! You're my hero !
> But what was the problem ( and the fix ) ?

the xosd plugin was opened first and didnt initialise multithreading support in libX11 while using it, later, when vlc would try to initialise it (because it requires it since its multithreaded), it wouldnt work correctly and lead to crashes.
vlc developpers implemented a check for this and vlc aborts if it detects things happened like that, which check is what you hit.