Opened 7 years ago

Closed 6 years ago

#2136 closed defect (fixed)

embedded video triggers X-error

Reported by: md Owned by: courmisch
Priority: high Milestone: 1.0 bugs
Component: Core: Video output Version: master git
Severity: blocker Keywords: VideoWidget
Cc: Difficulty: unknown
Platform(s): Win32+Linux Work status: Not started

Description

Some users are reporting crashes when using embedded video in Qt intf.

The most complete log seems to be this one:

[00000449] main video output debug: window size: 656x368
[00000449] main video output debug: looking for video output module: 6 candidate
s
[00000449] xvideo video output debug: adaptor 0, port 131, format 0x32315659 (YV
12) planar
[00000452] main window debug: looking for vout window module: 2 candidates
[00000452] qt4 window debug: waiting for interface...
[00000452] qt4 window debug: requesting window...
[00000403] qt4 interface debug: Video was requested -1, -1
[????????] x11 video output error: X11 request 59.0 failed with error code 8:
 BadMatch (invalid parameter attributes)
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  59 (X_SetClipRectangles)
  Serial number of failed request:  53879
  Current serial number in output stream:  53972
Locking assertion failure.  Backtrace:
#0 /usr/lib/libxcb-xlib.so.0 [0xb1ade767]
#1 /usr/lib/libxcb-xlib.so.0(xcb_xlib_lock+0x2e) [0xb1ade81e]
#2 /usr/lib/libX11.so.6 [0xb1c70ba9]
#3 /usr/lib/libXrender.so.1(XRenderFreePicture+0x41) [0xb1de2ce1]
#4 /usr/lib/libQtGui.so.4 [0xb22a5a8f]
#5 /usr/lib/libQtGui.so.4 [0xb22a64fa]
#6 /usr/lib/libQtGui.so.4(_ZN7QPixmap5derefEv+0x5d) [0xb229bffd]
#7 /usr/lib/libQtGui.so.4(_ZN7QPixmapD2Ev+0x2d) [0xb229e7bd]
#8 /usr/lib/libQtGui.so.4 [0xb22a0b9a]
#9 /usr/lib/libQtGui.so.4 [0xb22a0d9f]
#10 /usr/lib/libQtGui.so.4 [0xb22a084a]
#11 /lib/libc.so.6(exit+0x89) [0xb7c7c6c9]
#12 /usr/lib/libX11.so.6 [0xb1c6954e]
#13 ./modules/video_output/x11/.libs/libxvideo_plugin.so [0xae843910]
#14 /usr/lib/libX11.so.6(_XError+0xd9) [0xb1c69629]
#15 /usr/lib/libX11.so.6 [0xb1c71548]
#16 /usr/lib/libX11.so.6(_XReply+0x152) [0xb1c718f2]
#17 /usr/lib/libX11.so.6(XGetImage+0x99) [0xb1c4e2b9]
#18 /usr/lib/libQtGui.so.4 [0xb22a880e]
#19 /usr/lib/libQtGui.so.4(_ZNK7QPixmap7toImageEv+0x3b) [0xb229c26b]

KDE apps are hit by similar errors - e.g.

http://bugs.kde.org/show_bug.cgi?id=166664

Anyone experiencing this crash please post the Qt4 version in use.

Attachments (1)

reproduce.patch (921 bytes) - added by courmisch 7 years ago.
Reproducability patch

Download all attachments as: .zip

Change History (17)

comment:1 Changed 7 years ago by jb

Qt4.2 ? normal.

comment:2 Changed 7 years ago by md

I personnaly can't reproduce it and courmisch hasn't provided any info about Qt4 version where it crashed.

Anyway, if it's only for those old versions, I propose to reenable embedded again and eventually disable it only when HAS_QT43 is *not* set.

comment:3 Changed 7 years ago by random

disabling embedded video certainly isn't a fix, short and long term.

comment:4 Changed 7 years ago by courmisch

  • Component changed from I don't know to Video output core
  • Owner courmisch deleted

comment:5 Changed 7 years ago by courmisch

  • Resolution set to fixed
  • Status changed from new to closed

comment:6 Changed 7 years ago by courmisch

  • Milestone changed from Bugs paradize to 0.9.0 bugs
  • Priority changed from normal to high
  • Severity changed from normal to blocker
  • Summary changed from embedded video triggers X-error with some Qt4 version(s) to embedded video triggers X-error

Actually, the problem is there. We are deleting the Qt4 main interface outside of the Qt4 video lock, which triggers a race between the (proper) WindowClose?() and the deletion of the VideoWidget?.

On the other hand, deleting the main interface inside the video lock will cause a recursion deadlock, as the main interface tries to delete the video widget which releases the video output which calls WindowClose?() which takes the video lock.

comment:7 Changed 7 years ago by courmisch

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:8 Changed 7 years ago by jb

So, now the problem is still there, but on quit?

Changed 7 years ago by courmisch

Reproducability patch

comment:9 Changed 7 years ago by courmisch

This patch adds an msleep() that makes the race condition much more apparent. Then it re-enables the embedded video as it's currently off on Linux. Then again, I see no reasons why the bug would not affect Windows too (seems not specific to X at all).

comment:10 follow-up: Changed 7 years ago by courmisch

On 0.9-bugfix:

[00000349] main window debug: removing module "qt4"
[00000347] main video output debug: removing module "xvideo"
[00000339] main input debug: Program doesn't contain anymore ES
[00000343] main demux debug: removing module "ps"
[00000341] main access debug: removing module "access_file"
[00000339] main input debug: thread ended
[00000327] main playlist debug: dead input
[00000339] main input debug: thread 2964323216 joined (playlist/engine.c:244)
LibVLC fatal error locking mutex in thread 2974280592 at xcommon.c:3112: 22
 Error message: Argument invalide at:
/home/remi/videolan/bugfix/src/.libs/libvlccore.so.0(vlc_pthread_fatal+0xa7)[0xb7f94a37]
./modules/video_output/x11/.libs/libxvideo_plugin.so[0xb54a11cc]
./modules/gui/qt4/.libs/libqt4_plugin.so[0xb6712b3c]
./modules/gui/qt4/.libs/libqt4_plugin.so(_ZN11VideoWidgetD0Ev+0xc9)[0xb6712fa9]
/usr/lib/libQtCore.so.4(_ZN14QObjectPrivate14deleteChildrenEv+0x6f)[0xb651c26f]
/usr/lib/libQtGui.so.4(_ZN7QWidgetD0Ev+0x158)[0xb5c5c328]
/usr/lib/libQtCore.so.4(_ZN14QObjectPrivate14deleteChildrenEv+0x6f)[0xb651c26f]
/usr/lib/libQtGui.so.4(_ZN7QWidgetD2Ev+0x158)[0xb5c5c788]
/usr/lib/libQtGui.so.4(_ZN11QMainWindowD2Ev+0x31)[0xb5faa5d1]
./modules/gui/qt4/.libs/libqt4_plugin.so(_ZN13MainInterfaceD0Ev+0x41e)[0xb665830e]
./modules/gui/qt4/.libs/libqt4_plugin.so[0xb6647c2f]
/home/remi/videolan/bugfix/src/.libs/libvlccore.so.0[0xb7f23e6d]
/home/remi/videolan/bugfix/src/.libs/libvlccore.so.0[0xb7f9463a]
/lib/i686/cmov/libpthread.so.0[0xb7eda4c0]
/lib/i686/cmov/libc.so.6(clone+0x5e)[0xb7e2f61e]
Aborted

comment:11 Changed 7 years ago by courmisch

  • Platform(s) changed from Linux to Win32+Linux

comment:12 in reply to: ↑ 10 Changed 7 years ago by random

  • Keywords VideoWidget added

Replying to courmisch:

On 0.9-bugfix:

[00000349] main window debug: removing module "qt4"
[00000347] main video output debug: removing module "xvideo"
[00000339] main input debug: Program doesn't contain anymore ES
[00000343] main demux debug: removing module "ps"
[00000341] main access debug: removing module "access_file"
[00000339] main input debug: thread ended
[00000327] main playlist debug: dead input
[00000339] main input debug: thread 2964323216 joined (playlist/engine.c:244)
LibVLC fatal error locking mutex in thread 2974280592 at xcommon.c:3112: 22
 Error message: Argument invalide at:
/home/remi/videolan/bugfix/src/.libs/libvlccore.so.0(vlc_pthread_fatal+0xa7)[0xb7f94a37]
./modules/video_output/x11/.libs/libxvideo_plugin.so[0xb54a11cc]
./modules/gui/qt4/.libs/libqt4_plugin.so[0xb6712b3c]
./modules/gui/qt4/.libs/libqt4_plugin.so(_ZN11VideoWidgetD0Ev+0xc9)[0xb6712fa9]
/usr/lib/libQtCore.so.4(_ZN14QObjectPrivate14deleteChildrenEv+0x6f)[0xb651c26f]
/usr/lib/libQtGui.so.4(_ZN7QWidgetD0Ev+0x158)[0xb5c5c328]
/usr/lib/libQtCore.so.4(_ZN14QObjectPrivate14deleteChildrenEv+0x6f)[0xb651c26f]
/usr/lib/libQtGui.so.4(_ZN7QWidgetD2Ev+0x158)[0xb5c5c788]
/usr/lib/libQtGui.so.4(_ZN11QMainWindowD2Ev+0x31)[0xb5faa5d1]
./modules/gui/qt4/.libs/libqt4_plugin.so(_ZN13MainInterfaceD0Ev+0x41e)[0xb665830e]
./modules/gui/qt4/.libs/libqt4_plugin.so[0xb6647c2f]
/home/remi/videolan/bugfix/src/.libs/libvlccore.so.0[0xb7f23e6d]
/home/remi/videolan/bugfix/src/.libs/libvlccore.so.0[0xb7f9463a]
/lib/i686/cmov/libpthread.so.0[0xb7eda4c0]
/lib/i686/cmov/libc.so.6(clone+0x5e)[0xb7e2f61e]
Aborted


According to this it crashed on Exit on vlc.git master seem like there's 2 race condition bugs then just 1 bug.
On 0.9-bugfix the race condition bug appear on Start and on in between Next.
And dead lock after this line "qt4 interface debug: Video was requested -1, -1"
Which makes it impossible to back trace.
But after many experiments I've narrowed it down to this line where it started the dead lock

void *VideoWidget::request( vout_thread_t *p_nvout, int *pi_x, int *pi_y,
                            unsigned int *pi_width, unsigned int *pi_height )
{
    msg_Dbg( p_intf, "Video was requested %i, %i", *pi_x, *pi_y );

emit askVideoWidgetToShow( *pi_width, *pi_height ); <============= DEAD LOCK HERE emitting signal.


comment:13 Changed 7 years ago by courmisch

  • Milestone changed from 0.9.0 bugs to 0.9.x maintainance

Move to open milestone

comment:14 Changed 6 years ago by courmisch

  • Milestone changed from 0.9.x maintainance to 1.0 bugs

comment:15 Changed 6 years ago by courmisch

  • Owner set to courmisch
  • Status changed from reopened to new

comment:16 Changed 6 years ago by courmisch

  • Resolution set to fixed
  • Status changed from new to closed

Fenrir committed the last parts of the fix lately.

Note: See TracTickets for help on using tickets.