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

Android: Raster Plugin Crash on Race in QWindowSystemInterface::handleApplicationStateChanged

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Not Evaluated Not Evaluated
    • 5.2.0 RC1
    • 5.2.0 Beta1
    • QPA
    • None
    • Android
    • eef293b1a02efaa0206f1b9c5086a15cf659ad7d

      After BodDan fixed QTBUG-34582 textedit crash in raster plugin,
      my application has another crash with raster plugin with logcat output
      attached.

      Unfortunately, it was not reproducible with textedit example;
      attempts to make a small example by cutting meat from my application
      have only lead to the issue not being reproducible any more.

      There is a 100% reproducibility of the crash with my application, though.

      The stack seen in debugger is:
      0 QWindowSystemInterface::handleApplicationStateChanged qwindowsysteminterface.cpp 138 0x7382dd58
      1 updateApplicationState androidjnimain.cpp 665 0x745b9dd0
      2 ?? 0x40930c50
      3 ?? 0x40930c50

      The crash point is in the Q_ASSERT below in QWindowSystemInterface::handleApplicationStateChanged
      due to QGuiApplicationPrivate::platformIntegration() returning 0x0
      in the code below:

      void QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationState newState)
      {
      Q_ASSERT(QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ApplicationState));
      QWindowSystemInterfacePrivate::ApplicationStateChangedEvent *e =
      new QWindowSystemInterfacePrivate::ApplicationStateChangedEvent(newState);
      QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
      }

      The Q_ASSERT above is based on the assumption that
      QGuiApplicationPrivate::platformIntegration() cannot be NULL and no need to
      check it.

      THE WORKAROUND/ (FIX?) found is here:

      void QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationState newState)
      {
      //Q_ASSERT(QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ApplicationState));

      if (! QGuiApplicationPrivate::platformIntegration())
      return;

      if (! QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ApplicationState))
      return;

      QWindowSystemInterfacePrivate::ApplicationStateChangedEvent *e =
      new QWindowSystemInterfacePrivate::ApplicationStateChangedEvent(newState);
      QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
      }

      If there's a better/proper fix, I can give it a try.

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

            esabraha Eskil Abrahamsen Blomfeldt
            coroberti Robert Iakobashvili
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes