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

Crash when screen is lost

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P2: Important
    • None
    • 5.12.5, 5.15.1
    • GUI: Window management
    • Windows 10
      Nvidia GeForce RTX 2060 super
      2560*1440 display with 100% display ratio
      3840*2160 display with 150% display ratio
      both displays plugged in the GeForce
    • Windows

    Description

      Hi.

      We encounter this problem since we migrated from QT 5.9 to QT 5.12 :

      • On Windows, for users connecting through RDP, going to sleepmode, or using Cintiq tablets (those are actually screens), our application would crash.
      • This happens only on Windows
      • If this is relevant, our application is using OpenGL contexts
      • Unfortunately, I was not able to reproduce the case with a minimal Qt App (simple window with OGL Context), only with our full application which I cannot share.

      We are not able to reproduce on every configurations, but I was able to reproduce on my system, erratically, using 2 monitors plugged in the same graphic card, and play with the Windows display settings (extended, clone, display only on 1, only on 2).

      • Launching the software on display 1 while display mode is extended
      • Changing the Window to the display 2
      • Setting only on display 1 in Windows settings
      • Or maybe the opposite, as I said this is erratic

      I had the chance to debug the software and found 2 portions of code with suspicious behaviour:

      • First, and assert isn't satisfied here :
        // qcoreapplication.cpp l.568
        
        void QCoreApplicationPrivate::checkReceiverThread(QObject *receiver)
        {
            QThread *currentThread = QThread::currentThread();
            QThread *thr = receiver->thread();
            Q_ASSERT_X(currentThread == thr || !thr, ...);
        

        But as this is an assert, that maybe not the root cause, plus it would not be hit in production, so I skipped to the end of the checkRecevierThread function in order to continue the execution flow

      • Second, the creationContext of the QWindowsWindow gets uninitialized value
        // qwindowswindow.cpp l.1312
        
        void QWindowsWindow::initialize()
        {
            // Clear the creation context as the window can be found in QWindowsContext's map.
            QWindowCreationContextPtr creationContext =
                QWindowsContext::instance()->setWindowCreationContext(QWindowCreationContextPtr());

        Here, creationContext is sometimes uninitialized, leading creationContext->requestedGeometryIn to crash due to read access violation

      • If I skip again to the end of the function when this happens, the application continue working as expected

       

      Thank you for your help.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            jarrige_adobe.com Julien JARRIGE
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes