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

Reparenting items with animation to null causes crash in QSGNode::setMatrix

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.4, 6.2, 6.5
    • 5.14.2, 5.15.2, 6.2.0, 6.4
    • Quick: SceneGraph
    • None
    • macOS Big Sur 11.5.2
    • All
    • 0359381bc78fb69999d3c687d617858f9666c0aa

    Description

      Reproduction:

      Run the attached QML file and just click on the window. It crashes immediately. Reproducible %100.

      What happens:

      Setting the parent of a quick item invalidates its scene graph nodes :

      https://code.woboq.org/qt6/qtdeclarative/src/quick/items/qquickwindow.cpp.html#1704

      But those items are cached in QQuickAnimatorJob:

      https://code.woboq.org/qt5/qtdeclarative/src/quick/util/qquickanimatorjob_p.h.html#QQuickTransformAnimatorJob::Helper::node

      And the cache is not updated after the deletion hence QQuickAnimatorJob accesses a dangling pointer :

      https://code.woboq.org/qt5/qtdeclarative/src/quick/util/qquickanimatorjob.cpp.html#415

      The stack trace is almost same as the one mentioned in this issue : QTBUG-43294

      However I don't see the markDirty() call at the end. I've attached the traces.

      Fix:
      The issue is fixed if we update the QQuickAnimatorJob cache.  The proposed patch in QTBUG-43294https://codereview.qt-project.org/c/qt/qtdeclarative/+/101974 ) properly fixes the issue. I guess the author was bitten by something else and thought that that's not a correct fix and abandoned his diff. 

      Can we just resurrect that patch ? If not, I can send a new one.

      Attachments

        1. crash.qml
          0.5 kB
        2. trace
          9 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            janichol Andy Nichols
            murat murat
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes