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

xcb: XError recurses & hangs after XLib request buffer filled up

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.0.1
    • 5.0.0
    • GUI: Window management
    • None
    • OpenSUSE 12.10 kwin, Qt 5.0.0.
    • d2e64c47ce63607e7c4159ad9fb6a31e6652f8b8

    Description

      Qt Creator on top of Qt 5 / xcb frequently hangs after a while, see e.g. QTCREATORBUG-8473 . The stack trace points to a recursion happening in xlib / XError, e.g.

      0	pthread_cond_wait@@GLIBC_2.3.2	/lib64/libpthread.so.0		0x7f3bb14a18f4	
      1	_XReply	xcb_io.c	595	0x7f3bb08dd8fd	
      2	_XSeqSyncFunction	XlibInt.c	232	0x7f3bb08e0401	
      3	_XError	XlibInt.c	1585	0x7f3bb08dfbbb	
      4	handle_error	xcb_io.c	212	0x7f3bb08dcdf1	
      5	handle_response	xcb_io.c	324	0x7f3bb08dce35	
      6	_XReply	xcb_io.c	647	0x7f3bb08dd9d3	
      7	_XSeqSyncFunction	XlibInt.c	232	0x7f3bb08e0401	
      8	_XError	XlibInt.c	1585	0x7f3bb08dfbbb	
      9	handle_error	xcb_io.c	212	0x7f3bb08dcdf1	
      10	handle_response	xcb_io.c	324	0x7f3bb08dce35	
      11	_XReply	xcb_io.c	647	0x7f3bb08dd9d3	
      12	_XSeqSyncFunction	XlibInt.c	232	0x7f3bb08e0401	
      13	XCreateWindow	Window.c	117	0x7f3bb08db942	
      

      _XSeqSyncFunction calls _XReply here because the number of outstanding XLib request packages is too big, and hits a buffer boundary:

      if ((dpy->request - dpy->last_request_read) >= (65535 - BUFSIZE/SIZEOF(xReq))) {
        // ...
      }
      

      This is due to QXcbWindow::create() creating requests, but apparently never syncing the XLib connection. A workaround seems to be to add an

      XSync(dpy, false)
      

      at the end of QXcbWindow::create().

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-29106
          # Subject Branch Project Status CR V

          Activity

            People

              kkohne Kai Köhne
              kkohne Kai Köhne
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes