Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-42738

Deadlock in XCB between xcb_wait_for_event and XIQueryDevice

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Out of scope
    • Icon: P1: Critical P1: Critical
    • None
    • 5.3.2
    • QPA: X11/XCB
    • None
    • Debian 7, i86_64, Xfce window manager

      I've been encountering a deadlock in qt-5.3.2 that occurs randomly. Sometimes after minutes, sometimes after days. It requires a kill -9 to close the app.

      The two threads that seem to be the cause have these backtraces:

      Thread 1 (Thread 0xb05dd700 (LWP 14644)):
      #0 0xb776e424 in __kernel_vsyscall ()
      #1 0xb25dcc4b in pthread_cond_wait@@GLIBC_2.3.2 ()
      at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:187
      #2 0xb2d86273 in _XConditionWait (cv=0x9a1ec90, mutex=0x9a1a0f0) at ../../src/locking.c:353
      #3 0xb2d98d16 in _XReply (dpy=dpy@entry=0x9a1e2d0, rep=rep@entry=0xbfe81250, extra=extra@entry=0,
      discard=discard@entry=1) at ../../src/xcb_io.c:596
      #4 0xb2d9b7c8 in _XSeqSyncFunction (dpy=0x9a1e2d0) at ../../src/XlibInt.c:232
      #5 0xb2d9b017 in _XError (dpy=dpy@entry=0x9a1e2d0, rep=rep@entry=0xac703b98) at ../../src/XlibInt.c:1465
      #6 0xb2d97d06 in handle_error (dpy=dpy@entry=0x9a1e2d0, err=0xac703b98, in_XReply=in_XReply@entry=1)
      at ../../src/xcb_io.c:213
      #7 0xb2d97dbe in handle_response (dpy=dpy@entry=0x9a1e2d0, response=0xac703b98, in_XReply=in_XReply@entry=1)
      at ../../src/xcb_io.c:325
      #8 0xb2d98ddc in _XReply (dpy=dpy@entry=0x9a1e2d0, rep=rep@entry=0xbfe81440, extra=extra@entry=0,
      discard=discard@entry=0) at ../../src/xcb_io.c:648
      #9 0xb274d880 in XIQueryDevice (dpy=0x9a1e2d0, deviceid=0, ndevices_return=0xbfe81528) at ../../src/XIQueryDevice.c:60
      #10 0xad0f0f5d in QXcbConnection::xi2SetupDevices (this=0x9a1dfb0) at qxcbconnection_xi2.cpp:114
      #11 0xad0f3a79 in QXcbConnection::xi2HandleHierachyEvent (this=0x9a1dfb0, event=0xa9ef728) at qxcbconnection_xi2.cpp:583
      #12 0xad0f2635 in QXcbConnection::xi2HandleEvent (this=0x9a1dfb0, event=0xa9ef728) at qxcbconnection_xi2.cpp:431
      #13 0xad0c8c60 in QXcbConnection::handleXcbEvent (this=0x9a1dfb0, event=0xa9ef728) at qxcbconnection.cpp:914
      #14 0xad0c9dc8 in QXcbConnection::processXcbEvents (this=0x9a1dfb0) at qxcbconnection.cpp:1244
      #15 0xad0fd023 in QXcbConnection::qt_static_metacall (_o=0x9a1dfb0, _c=QMetaObject::InvokeMetaMethod, _id=2,
      _a=0xac70f908) at .moc/moc_qxcbconnection.cpp:190
      #16 0xb472f178 in QMetaCallEvent::placeMetaCall (this=0xac70fa78, object=0x9a1dfb0) at kernel/qobject.cpp:487
      #17 0xb47300b8 in QObject::event (this=0x9a1dfb0, e=0xac70fa78) at kernel/qobject.cpp:1241
      #18 0xb594d00c in QApplicationPrivate::notify_helper (this=0x9a18b40, receiver=0x9a1dfb0, e=0xac70fa78)
      at kernel/qapplication.cpp:3499
      #19 0xb594a92a in QApplication::notify (this=0x9a189a8, receiver=0x9a1dfb0, e=0xac70fa78) at kernel/qapplication.cpp:2952
      #20 0xb5fc037d in qmap::LoggingApplication::_notify (this=0x9a189a8, obj=0x9a1dfb0, event=0xac70fa78)
      at /home/mrsys/git/master/src/libs/qmap/loggingapplication.cpp:394
      #21 0xb5fc04c2 in qmap::LoggingApplication::notify (this=0x9a189a8, obj=0x9a1dfb0, event=0xac70fa78)
      at /home/mrsys/git/master/src/libs/qmap/loggingapplication.cpp:256
      #22 0xb46f8a1a in QCoreApplication::notifyInternal (this=0x9a189a8, receiver=0x9a1dfb0, event=0xac70fa78)
      at kernel/qcoreapplication.cpp:935
      #23 0xb46fc64c in QCoreApplication::sendEvent (receiver=0x9a1dfb0, event=0xac70fa78)
      at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:237
      #24 0xb46f9c10 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x9a10420)
      at kernel/qcoreapplication.cpp:1539
      #25 0xb46f96b1 in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at kernel/qcoreapplication.cpp:1397
      #26 0xb4766474 in postEventSourceDispatch (s=0x9a349a0) at kernel/qeventdispatcher_glib.cpp:279
      #27 0xb08c4313 in g_main_context_dispatch () from /lib/i386-linux-gnu/libglib-2.0.so.0
      #28 0xb08c4598 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
      #29 0xb08c4658 in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
      #30 0xb4766ba3 in QEventDispatcherGlib::processEvents (this=0x9a34990, flags=...) at kernel/qeventdispatcher_glib.cpp:426
      #31 0xad0fe199 in QPAEventDispatcherGlib::processEvents (this=0x9a34990, flags=...)
      at eventdispatchers/qeventdispatcher_glib.cpp:123
      #32 0xb46f575d in QEventLoop::processEvents (this=0xbfe825a0, flags=...) at kernel/qeventloop.cpp:136
      #33 0xb46f5a0f in QEventLoop::exec (this=0xbfe825a0, flags=...) at kernel/qeventloop.cpp:212
      #34 0xb46f9112 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1188
      #35 0xb4aa4aaa in QGuiApplication::exec () at kernel/qguiapplication.cpp:1483
      #36 0xb594a197 in QApplication::exec () at kernel/qapplication.cpp:2744

      Thread 4 (Thread 0xad0a3b40 (LWP 14651)):
      #0 0xb776e424 in __kernel_vsyscall ()
      #1 0xb2502dfb in poll () at ../sysdeps/unix/syscall-template.S:81
      #2 0xb238a7a8 in poll (__timeout=-1, __nfds=1, __fds=0xad0a31fc) at /usr/include/i386-linux-gnu/bits/poll2.h:46
      #3 _xcb_conn_wait (c=c@entry=0x9a1eef8, cond=cond@entry=0x9a1ef1c, vector=vector@entry=0x0, count=count@entry=0x0)
      at ../../src/xcb_conn.c:447
      #4 0xb238c794 in xcb_wait_for_event (c=0x9a1eef8) at ../../src/xcb_in.c:622
      #5 0xad0c9588 in QXcbEventReader::run (this=0x9a28950) at qxcbconnection.cpp:1046
      #6 0xb44fd812 in QThreadPrivate::start (arg=0x9a28950) at thread/qthread_unix.cpp:345
      #7 0xb25d8efb in start_thread (arg=0xad0a3b40) at pthread_create.c:312
      #8 0xb2510f5e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:129

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            allan.jensen Allan Sandfeld Jensen
            phorrocks89 Peter Horrocks
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes