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

Crash in ~QQuickScrollBarAttached during rearrange of QQmlDelegateModel

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • None
    • 5.15.5
    • Quick: Controls 2
    • None
    • Linux/X11

    Description

      Something during destruction of a delegate with a ScrollView causes "Segmentation fault."

      Here's a formatted stacktrace from gdb, along with some "print" commands attached.

      It happens a bit randomly when filtering a list through a proxy model. The delegate in this case is quite complex, and contains a QtQuick.Controls.2/Checkbox; and our implementation of CheckBox's QQC2 style uses a scrollable listview in its dropdown/popup.

      I have most KDE packages built from git master (frameworks+workspace+desktop). The bug appears when testing this patch: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1827/diffs?diff_id=390994, with this command: $ gdb --args plasmoidviewer -a org.kde.plasma.systemtray.

      See also: https://bugreports.qt.io/browse/QTBUG-82285

      Here are N top lines of a traceback from the attachment, to make this bug report searchable:

      #0  QVector<QQuickItemPrivate::ChangeListener>::indexOf(QQuickItemPrivate::ChangeListener const&, int) const [clone .constprop.0] [clone .isra.0] (t=..., from=0, this=<optimized out>) at /usr/include/qt/QtCore/qvector.h:1002
      #1  0x00007ffff7a91414 in QVector<QQuickItemPrivate::ChangeListener>::removeOne(QQuickItemPrivate::ChangeListener const&) (t=..., this=<optimized out>) at /usr/include/qt/QtCore/qvector.h:180
      #2  QQuickItemPrivate::removeItemChangeListener(QQuickItemChangeListener*, QFlags<QQuickItemPrivate::ChangeType>) (this=0x555558a1b360, listener=<optimized out>, types=...) at /usr/src/debug/qtdeclarative/src/quick/items/qquickitem.cpp:3924
      #3  0x00007fffef62e05c in QQuickScrollBarAttachedPrivate::setFlickable(QQuickFlickable*) (this=this@entry=0x55555897cac0, item=item@entry=0x0) at /usr/src/debug/qtquickcontrols2/src/quicktemplates2/qquickscrollbar.cpp:766
      #4  0x00007fffef62e303 in QQuickScrollBarAttached::~QQuickScrollBarAttached() (this=0x555558e41140, this=<optimized out>) at /usr/src/debug/qtquickcontrols2/src/quicktemplates2/qquickscrollbar.cpp:1017
      #5  0x00007fffef62e32e in QQuickScrollBarAttached::~QQuickScrollBarAttached() (this=0x555558e41140, this=<optimized out>) at /usr/src/debug/qtquickcontrols2/src/quicktemplates2/qquickscrollbar.cpp:1018
      #6  0x00007ffff59052e5 in QObjectPrivate::deleteChildren() (this=this@entry=0x555558a7d8e0) at kernel/qobject.cpp:2104
      #7  0x00007ffff5905a79 in QObject::~QObject() (this=0x555558aaa130, this=<optimized out>) at kernel/qobject.cpp:1082
      #8  0x00007fffe4c1e1a3 in QQuickScrollView::~QQuickScrollView() (this=0x555558aaa130, this=<optimized out>) at ../../../include/QtQuickTemplates2/5.15.5/QtQuickTemplates2/private/../../../../../../qtquickcontrols2/src/quicktemplates2/qquickscrollview_p.h:58
      #9  QQmlPrivate::QQmlElement<QQuickScrollView>::~QQmlElement() (this=0x555558aaa130, this=<optimized out>) at /usr/include/qt/QtQml/qqmlprivate.h:144
      #10 QQmlPrivate::QQmlElement<QQuickScrollView>::~QQmlElement() (this=0x555558aaa130, this=<optimized out>) at /usr/include/qt/QtQml/qqmlprivate.h:144
      #11 0x00007ffff76477c6 in QQmlObjectCreator::clear() (this=<optimized out>) at /usr/src/debug/qtdeclarative/src/qml/qml/qqmlobjectcreator.cpp:1461
      #12 QQmlObjectCreator::clear() (this=0x555559223cb0) at /usr/src/debug/qtdeclarative/src/qml/qml/qqmlobjectcreator.cpp:1452
      #13 0x00007ffff75eb0f1 in QQmlIncubatorPrivate::clear() (this=0x5555590b8180) at /usr/src/debug/qtdeclarative/src/qml/qml/qqmlincubator.cpp:174
      #14 0x00007ffff75eadf0 in QQmlIncubator::clear() (this=this@entry=0x555558e5c690) at /usr/src/debug/qtdeclarative/src/qml/qml/qqmlincubator.cpp:606
      #15 0x00007ffff7827ff9 in QQmlDelegateModelPrivate::releaseIncubator(QQDMIncubationTask*) (this=0x555558784410, incubationTask=0x555558e5c690) at /usr/src/debug/qtdeclarative/src/qmlmodels/qqmldelegatemodel.cpp:1074
      #16 0x00007ffff782b679 in QQmlDelegateModelPrivate::itemsRemoved(QVector<QQmlListCompositor::Remove> const&, QVarLengthArray<QVector<QQmlChangeSet::Change>, 11>*, QHash<int, QList<QQmlDelegateModelItem*> >*) (this=this@entry=0x555558784410, removes=<optimized out>, translatedRemoves=translatedRemoves@entry=0x7fffffffb4b0, movedItems=movedItems@entry=0x0) at /usr/src/debug/qtdeclarative/src/qmlmodels/qqmldelegatemodel.cpp:1677
      #17 0x00007ffff782bc0b in QQmlDelegateModelPrivate::itemsRemoved(QVector<QQmlListCompositor::Remove> const&) (this=this@entry=0x555558784410, removes=...) at /usr/src/debug/qtdeclarative/src/qmlmodels/qqmldelegatemodel.cpp:1714
      #18 0x00007ffff782e2ac in QQmlDelegateModel::_q_itemsRemoved(int, int) (this=<optimized out>, index=9, count=5) at /usr/src/debug/qtdeclarative/src/qmlmodels/qqmldelegatemodel.cpp:1757
      #19 0x00007ffff7836da3 in QQmlDelegateModel::qt_metacall(QMetaObject::Call, int, void**) (this=0x5555587843c0, _c=QMetaObject::InvokeMetaMethod, _id=14, _a=0x7fffffffb6d0) at .moc/moc_qqmldelegatemodel_p.cpp:371
      #20 0x00007ffff590ef9d in doActivate<false>(QObject*, int, void**) (sender=0x555558784a90, signal_index=15, argv=0x7fffffffb6d0) at kernel/qobject.cpp:3912
      #21 0x00007ffff5897f53 in QAbstractItemModel::rowsRemoved(QModelIndex const&, int, int, QAbstractItemModel::QPrivateSignal) (this=this@entry=0x555558784a90, _t1=..., _t2=<optimized out>, _t3=<optimized out>, _t4=...) at .moc/moc_qabstractitemmodel.cpp:606
      #22 0x00007ffff58980b7 in QAbstractItemModel::endRemoveRows() (this=0x555558784a90) at itemmodels/qabstractitemmodel.cpp:2835
      

      Attachments

        Issue Links

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

          Activity

            People

              mitch_curtis Mitch Curtis
              ratijas ivan tkachenko
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes