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

Crash after disconnecting monitor

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.2.0
    • 5.1.0
    • GUI: Window management
    • None
    • f738a4a5d5f62c1136b5820a89c9b47080d150a4 (reduces unnecessary window recreation, 5.1.2)

    Description

      If I disconnect a monitor while an application (e.g., Creator) is running, it will may refer to a removed screen and cause a crash.

      #0  0x00007ffff7170842 in QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::data (this=0x8)
          at ../../include/QtCore/../../../../../../src/qt/qt5/qtbase/src/corelib/tools/qscopedpointer.h:132
      #1  0x00007ffff71bd108 in qGetPtrHelper<QScopedPointer<QObjectData> > (p=...)
          at ../../include/QtCore/../../../../../../src/qt/qt5/qtbase/src/corelib/global/qglobal.h:889
      #2  0x00007ffff71bd204 in QScreen::d_func (this=0x0) at /home/thiago/src/qt/qt5/qtbase/src/gui/kernel/qscreen.h:67
      #3  0x00007ffff71bc016 in QScreen::handle (this=0x0) at /home/thiago/src/qt/qt5/qtbase/src/gui/kernel/qscreen.cpp:82
      #4  0x00007ffff717523e in QPlatformScreen::platformScreenForWindow (window=0x15307d0)
          at /home/thiago/src/qt/qt5/qtbase/src/gui/kernel/qplatformscreen.cpp:235
      #5  0x00007ffff79663dd in QWidget::metric (this=0x5d9130, m=QPaintDevice::PdmDpiY)
          at /home/thiago/src/qt/qt5/qtbase/src/widgets/kernel/qwidget_qpa.cpp:819
      #6  0x00007ffff71f3c58 in QPaintDevice::logicalDpiY (this=0x5d9140)
          at ../../include/QtGui/../../../../../../src/qt/qt5/qtbase/src/gui/painting/qpaintdevice.h:83
      #7  0x00007ffff72209a9 in QFont::QFont (this=0x7fffffffae30, font=..., pd=0x5d9140)
          at /home/thiago/src/qt/qt5/qtbase/src/gui/text/qfont.cpp:617
      #8  0x00007ffff7943480 in QWidget::initPainter (this=0x5d9130, painter=0x7fffffffb230)
          at /home/thiago/src/qt/qt5/qtbase/src/widgets/kernel/qwidget.cpp:11295
      #9  0x00007ffff73927c7 in QPainter::initFrom (this=0x7fffffffb230, device=0x5d9140)
          at /home/thiago/src/qt/qt5/qtbase/src/gui/painting/qpainter.cpp:1548
      #10 0x00007ffff7393a41 in QPainter::begin (this=0x7fffffffb230, pd=0x154ca50)
          at /home/thiago/src/qt/qt5/qtbase/src/gui/painting/qpainter.cpp:1827
      #11 0x00007ffff73924ca in QPainter::QPainter (this=0x7fffffffb230, pd=0x5d9140)
          at /home/thiago/src/qt/qt5/qtbase/src/gui/painting/qpainter.cpp:1474
      #12 0x00007ffff79351cd in QWidgetPrivate::drawWidget (this=0x5f8a00, pdev=0x154ca50, rgn=..., offset=..., flags=5, 
          sharedPainter=0x0, backingStore=0x1530f80) at /home/thiago/src/qt/qt5/qtbase/src/widgets/kernel/qwidget.cpp:5109
      #13 0x00007ffff790125a in QWidgetBackingStore::sync (this=0x1530f80)
          at /home/thiago/src/qt/qt5/qtbase/src/widgets/kernel/qwidgetbackingstore.cpp:1090
      #14 0x00007ffff792c37d in QWidgetPrivate::syncBackingStore (this=0x5f8a00)
          at /home/thiago/src/qt/qt5/qtbase/src/widgets/kernel/qwidget.cpp:1676
      #15 0x00007ffff793dda4 in QWidget::event (this=0x5d9130, event=0x94400e0)
          at /home/thiago/src/qt/qt5/qtbase/src/widgets/kernel/qwidget.cpp:8180
      #16 0x00007ffff7abe170 in QMainWindow::event (this=0x5d9130, event=0x94400e0)
          at /home/thiago/src/qt/qt5/qtbase/src/widgets/widgets/qmainwindow.cpp:1471
      #17 0x00007ffff78f1d3e in QApplicationPrivate::notify_helper (this=0x41ce20, receiver=0x5d9130, e=0x94400e0)
          at /home/thiago/src/qt/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3444
      #18 0x00007ffff78f1b9b in QApplication::notify (this=0x7fffffffc8f0, receiver=0x5d9130, e=0x94400e0)
          at /home/thiago/src/qt/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3409
      #19 0x00007ffff6d6ffdc in QCoreApplication::notifyInternal (this=0x7fffffffc8f0, receiver=0x5d9130, event=0x94400e0)
          at /home/thiago/src/qt/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:860
      #20 0x00007ffff6d73c6b in QCoreApplication::sendEvent (receiver=0x5d9130, event=0x94400e0)
          at ../../include/QtCore/../../../../../../src/qt/qt5/qtbase/src/corelib/kernel/qcoreapplication.h:232
      #21 0x00007ffff6d71304 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x41c380)
          at /home/thiago/src/qt/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1464
      #22 0x00007ffff6d70ca5 in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0)
          at /home/thiago/src/qt/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1322
      #23 0x00007ffff6de039a in postEventSourceDispatch (s=0x42c130)
          at /home/thiago/src/qt/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:279
      #24 0x0000003e6a847825 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
      #25 0x0000003e6a847b58 in ?? () from /lib64/libglib-2.0.so.0
      #26 0x0000003e6a847c14 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
      #27 0x00007ffff6de0b61 in QEventDispatcherGlib::processEvents (this=0x4216b0, flags=...)
          at /home/thiago/src/qt/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:426
      #28 0x00007ffff054dce6 in QPAEventDispatcherGlib::processEvents (this=0x4216b0, flags=...)
          at /home/thiago/src/qt/qt5/qtbase/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp:123
      #29 0x00007ffff6d6c796 in QEventLoop::processEvents (this=0x7fffffffc790, flags=...)
          at /home/thiago/src/qt/qt5/qtbase/src/corelib/kernel/qeventloop.cpp:136
      #30 0x00007ffff6d6ca83 in QEventLoop::exec (this=0x7fffffffc790, flags=...)
          at /home/thiago/src/qt/qt5/qtbase/src/corelib/kernel/qeventloop.cpp:212
      #31 0x00007ffff6d7069d in QCoreApplication::exec ()
          at /home/thiago/src/qt/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1113
      #32 0x00007ffff7181062 in QGuiApplication::exec ()
          at /home/thiago/src/qt/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:1198
      #33 0x00007ffff78eea1b in QApplication::exec () at /home/thiago/src/qt/qt5/qtbase/src/widgets/kernel/qapplication.cpp:2689
      #34 0x000000000040eb47 in main (argc=1, argv=0x7fffffffd8c8) at /home/thiago/src/qt/creator/src/app/main.cpp:527
      

      In frame 4, window is not null (it's a parameter) but window->screen() is null (see frame 3).

      This window was in the screen that got removed. It got moved when the screen was removed, but it's possible that the act of the window manager moving the window causes a redraw, that causes the crash.

      Attachments

        Issue Links

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

          Activity

            People

              srutledg Shawn Rutledge
              thiago Thiago Macieira
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes