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

Parrallel access to xcb and xlib without call to XInitThreads() causes race conditions on X11

    XMLWordPrintable

Details

    Description

      My application hitting the race condition regulary was a QtQuick 2.0 application with custom C++ code for window resize and move controlling for a frameless window.

      Race condition happened while Qt was using xcb to read event and request window position movements from two threads. Same time rendering thread was drawing scene with opengl. Opengl driver (mesa) is using Xlib for buffer management. Result is assert failure in libxcb in different threads. Same issue is described in

      https://bugs.freedesktop.org/show_bug.cgi?id=44198
      https://bugs.launchpad.net/ubuntu/+source/qtdeclarative-opensource-src/+bug/1179617

      Simple fix is to make sure that Qt calls XInitThreads before opening X11 connections. Too bad application could open X11 connection before calling Qt. In that case it should be application doing calling XInitThreads. But IMO Qt has to do the call for most applications because any Qt application using OpenGL rendering has this race condition currently.

      Attachments

        Issue Links

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

          Activity

            People

              jolind Jorgen Lind
              suokkos Pauli
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes