[vlc-devel] [VLC] #3074: VLC 1.0.2 crashes in X11/xvideo (was: VLC 1.0.2 crashes in X11)

Rémi Denis-Courmont remi at remlab.net
Mon Sep 21 18:56:09 CEST 2009

Le lundi 21 septembre 2009 15:54:41 VLC, vous avez écrit :
>  The current 1.0.2 version crashes immediately if video is to be played:
>  {{{
>  [0x849a788] main video output debug: looking for video output module: 6
>  candidates
>  [0x849a788] xvideo video output debug: adaptor 0, port 280, format
>  0x32315659 (YV12) planar
>  [0x837ef18] main window debug: looking for xwindow module: 3 candidates
>  [0x837ef18] qt4 window debug: requesting video...
>  [0x837ef18] main window debug: using xwindow module "qt4"
>  [0x837ef18] main window debug: TIMER module_need() : 1.575 ms - Total
>  1.575 ms / 1 intvls (Avg
>  1.575 ms)
>  [????????] x11 video output error: X11 request 2.0 failed with error code
>  3:
>   BadWindow (invalid Window parameter)
>  X Error of failed request:  BadWindow (invalid Window parameter)
>    Major opcode of failed request:  2 (X_ChangeWindowAttributes)
>    Resource id in failed request:  0x434689
>    Serial number of failed request:  25
>    Current serial number in output stream:  26
>  }}}

And I bet --no-embedded-video works around it... That BadWindow error was 
already in 1.0.{0,1}. The sad truth is, the embedded Qt4-X11 video never ever 
ever worked properly in VLC. It is well-known that the cleanup path was buggy 
in 0.9, and is believed to be fixed in 1.0. However, the initialization path 
is buggy in all existing VLC releases: we are not waiting for the X11 server 
to create the window before we use the window ID to the vout thread, through a 
different X11 connection. In some cases, the vout thread requests will be 
processed by the X server before the Qt4 ones, and then we get a BadWindow.

>  When I revert [61c5a86ae9c9d33f3ab43d059620c05fe9038ac8] things work
>  again.

That commit is orthogonal to the way the video-embedding window is created by 
the Qt4 plugin. It just moves a little bit of MainInterface code from the 
video thread (which was unsafe) to the Qt4 main loop thread. Either way, the 
window allocation code was and still is done from the Qt4 main loop. However, 
that commit might change the scheduling such that who/how the BadWindow race 
condition occurs changes.

882fff211a1b20d17ecda577063d4e07b7396c2e was supposed to fix this. As far as I 
can tell, it works, and I am out of ideas anyway.

Rémi Denis-Courmont

More information about the vlc-devel mailing list