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

XCB: QApplication crashes when there is no monitor connected using QT5

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.0.0, 5.2.0
    • Fix Version/s: 5.6.0
    • Component/s: GUI: Window management
    • Labels:
      None
    • Environment:
      CentOS 6.4 or 6.5, Qt 5.02 or 5.2.0, Qt Creator 2.7.1 or 3.0.0

      Description

      When I start the application on a headless machine, as some of our servers do not have monitors, the application crashes. I use teamviewer/vnc to graphically access these servers. Starting from:

      QApplication a(argc, argv);

      I have tracked this down to a core file call qxcbconnection.cpp and the line:

      xcb_create_window(m_connection, XCB_COPY_FROM_PARENT,
                        m_connectionEventListener, m_screens.at(0)->root(),
                        0, 0, 1, 1, 0, XCB_WINDOW_CLASS_INPUT_ONLY,
                        m_screens.at(0)->screen()->root_visual, 0, 0);

      The problem is, if there is no monitor connected, then m_screens is empty, and therefore causes an “index out of bounds” error.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              srutledg Shawn Rutledge
              Reporter:
              simy307 Brian Simonson
              Votes:
              3 Vote for this issue
              Watchers:
              20 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes