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

QUnifiedTimer::updateAnimationTimers() crashes when QApplication is recreated

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 6.8.3, 6.10
    • None
    • Linux/X11, VxWorks, Windows

    Description

      QApplication is created deleted in a for loop and the second run crashes when the QML XAnimator is running.

      Please check the attached sources code.

      When the restart period is longer than the animation period, then it is not crashing, the animation needs to be running while restart.

      SIGSEGV happends in QUnifiedTimer::updateAnimationTimers() at animation->updateAnimationsTime(delta); animation is probably not a valid pointer.

      main.cpp:

      static void testIt( int argc, char **argv ) {
          QGuiApplication app( argc, argv );
          QQuickView view;
          view.setSource( QStringLiteral( "qrc:/timercrash/Main.qml" ) );    view.resize( 1024, 768 );
          view.show();
          QTimer::singleShot( 1000, &app, [&]() {
              app.quit();
          } );
          app.exec();
      }

      int main(int argc, char **argv)
      {
         for( int i = 0; i < 10; ++i ) {
              qDebug() << "start iteration " << i;
              testIt( argc, argv );
              qDebug() << "end iteration " << i;
                }
          return 0;
      }
      Main.qml

      import QtQuick

      Rectangle {
          id: root
          anchors.fill: parent
          color: "lemonchiffon"    Rectangle {
              id: xmovingBox
              x: 0
              y: 0
              width: 50
              height: 50
              color: "lightsteelblue"
              XAnimator {
                  id: xanimator
                  target: xmovingBox;
                  from: 0;
                  to: 100;
                  duration: 2000
                  running: true
              }
                  }
       }

      Attachments

        1. timercrash.zip
          2 kB
          Karim Pinter
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            fabiankosmale Fabian Kosmale
            karimpinter Karim Pinter
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Jarno Lämsä Jarno Lämsä
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes