Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.7.2
Description
in a complex UI application when whole main UI is loaded into a window sized for a splash screen and then maximized that leads to crash. There are quite a few nested layouts with repeaters containing non trivial delegates. and it i hard to come up with an small reproducer, but this looks like a a race condition.
Looking at Qt source, it seems like following commit perhaps is the reason of this crash.https://codereview.qt-project.org/c/qt/qtdeclarative/+/565938
looking at this patch it seems, relaxing the check against invalidate in the patch is having an adverse effect. When the item is removed/destroyed, you can see the layout item is invalidated. Although obviously most cases are caught where the underlying item is deleted, it appears one code path is still allowing a way through, but now where invalidated() was true and it early returned, in a nested layout that is no longer the case. Even a brief look at the code shows that if an item is destroyed while !isReady() in the parent layout, which may be the case in our instance as it happens during initial UI load, you get left with a dangling pointer in a layoutitem.
Attaching full crash stack. But following part seems is the most relevent
Qt6Quickd.dll!QScopedPointer<QObjectData,QScopedPointerDeleter<QObjectData>>::get() Line 112 Qt6Quickd.dll!qGetPtrHelper<QScopedPointer<QObjectData,QScopedPointerDeleter<QObjectData>>>(QScopedPointer<QObjectData,QScopedPointerDeleter<QObjectData>> & ptr) Line 79 Qt6Quickd.dll!QQuickItem::d_func() Line 487 Qt6Quickd.dll!QQuickItem::setSize(const QSizeF & size) Line 7668 > Qt6QuickLayoutsd.dll!QQuickGridLayoutItem::setGeometry(const QRectF & rect) Line 87 Qt6Guid.dll!QGridLayoutEngine::setGeometries(const QRectF & contentsGeometry, const QAbstractLayoutStyleInfo * styleInfo) Line 1057 Qt6QuickLayoutsd.dll!QQuickGridLayoutBase::rearrange(const QSizeF & size) Line 478 Qt6QuickLayoutsd.dll!QQuickLayout::geometryChange(const QRectF & newGeometry, const QRectF & oldGeometry) Line 932 Qt6Quickd.dll!QQuickItem::setImplicitSize(double w, double h) Line 7626 Qt6QuickLayoutsd.dll!QQuickLayoutPrivate::applySizeHints() Line 759 Qt6QuickLayoutsd.dll!QQuickLayout::ensureLayoutItemsUpdated(QFlags<enum QQuickLayout::EnsureLayoutItemsUpdatedOption> options) Line 896 Qt6QuickLayoutsd.dll!QQuickLayout::ensureLayoutItemsUpdated(QFlags<enum QQuickLayout::EnsureLayoutItemsUpdatedOption> options) Line 890 Qt6QuickLayoutsd.dll!QQuickLayout::updatePolish() Line 801 Qt6Quickd.dll!QQuickWindowPrivate::polishItems() Line 349 Qt6Quickd.dll!QSGThreadedRenderLoop::polishAndSync(QSGThreadedRenderLoop::Window * w, bool inExpose) Line 1617
Update: Full stack dump is too large to attach here.