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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.6.0
    • 5.0.0, 5.2.0
    • GUI: Window management
    • None
    • 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

        1. freenx-gdb-qtcreator.txt
          6 kB
          Arthur Kahlich
        2. freenx-xdpyinfo-all.txt
          8 kB
          Arthur Kahlich
        3. local-xdpyinfo-all.txt
          23 kB
          Arthur Kahlich

        Issue Links

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

          Activity

            People

              srutledg Shawn Rutledge
              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