Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.6.2, 5.9.1, 5.12.0
-
None
-
-
9a9c526f6876fed7f23c79e4d82f6fe0fbc22041 (qt/qtdeclarative/dev)
Description
The crash happens when there is an attempt to change not yet finished sourceComponent in an asynchronous loader. The root cause is that the application wants/expects to have the ownership of the objects by setting QQmlEngine::CppOwnership, but QQmlObjectCreator will illegitimately delete all already created objects when sourceComponent is changed in the loader while loading is not done yet.
Relevant backtrace:
#0 0x0000000000000000 in ?? () #1 0x00007ffff6d944d1 in operator<< (dbg=..., o=0x2e521a0) at kernel/qobject.cpp:4115 #2 0x0000000000403f67 in TestModel::clear (this=0x763030) at ../LoaderCrash/testmodel.cpp:40 #3 0x0000000000403988 in TestModel::~TestModel (this=0x763030, __in_chrg=<optimized out>) at ../LoaderCrash/testmodel.cpp:13 #4 0x00000000004037c6 in QQmlPrivate::QQmlElement<TestModel>::~QQmlElement (this=0x763030, __in_chrg=<optimized out>) at ../../qt5.6.2/qt5/qtbase/include/QtQml/../../../qtdeclarative/src/qml/qml/qqmlprivate.h:98 #5 0x00000000004037f6 in QQmlPrivate::QQmlElement<TestModel>::~QQmlElement (this=0x763030, __in_chrg=<optimized out>) at ../../qt5.6.2/qt5/qtbase/include/QtQml/../../../qtdeclarative/src/qml/qml/qqmlprivate.h:98 #6 0x00007ffff746989a in QQmlObjectCreator::clear (this=0x48e9060) at qml/qqmlobjectcreator.cpp:1278 #7 0x00007ffff73d95fe in QQmlIncubatorPrivate::clear (this=0x3b99060) at qml/qqmlincubator.cpp:176 #8 0x00007ffff73da2df in QQmlIncubator::clear (this=0x1e48bc0) at qml/qqmlincubator.cpp:568 #9 0x00007fffec7b0409 in QQuickLoaderPrivate::clear (this=0x75bb30) at items/qquickloader.cpp:87 #10 0x00007fffec7b0dcd in QQuickLoader::setSourceComponent (this=0x889150, comp=0x0) at items/qquickloader.cpp:463 #11 0x00007fffec7b0e81 in QQuickLoader::resetSourceComponent (this=0x889150) at items/qquickloader.cpp:480 #12 0x00007fffec7b2782 in QQuickLoader::qt_static_metacall (_o=0x889150, _c=QMetaObject::ResetProperty, _id=2, _a=0x7fffffffac40) at .moc/moc_qquickloader_p.cpp:266 #13 0x00007fffec7b28ed in QQuickLoader::qt_metacall (this=0x889150, _c=QMetaObject::ResetProperty, _id=2, _a=0x7fffffffac40) at .moc/moc_qquickloader_p.cpp:309 #14 0x00007ffff6d59d5d in QMetaObject::metacall (object=0x889150, cl=QMetaObject::ResetProperty, idx=45, argv=0x7fffffffac40) at kernel/qmetaobject.cpp:295 #15 0x00007ffff73713e1 in QV4::QObjectWrapper::setProperty (engine=0x6600e0, object=0x889150, property=0x7fffe404e608, value=...) at jsruntime/qv4qobjectwrapper.cpp:489 #16 0x00007ffff7372605 in QV4::QObjectWrapper::setProperty (engine=0x6600e0, object=0x889150, propertyIndex=45, value=...) at jsruntime/qv4qobjectwrapper.cpp:656 #17 0x00007ffff7372577 in QV4::QObjectWrapper::setProperty (this=0x7fffecab23f0, engine=0x6600e0, propertyIndex=45, value=...) at jsruntime/qv4qobjectwrapper.cpp:641 #18 0x00007ffff7399e10 in QV4::Runtime::setQmlQObjectProperty (engine=0x6600e0, object=..., propertyIndex=45, value=...) at jsruntime/qv4runtime.cpp:1456 #19 0x00007ffff737fa30 in QV4::Moth::VME::run (this=0x7fffffffb467, engine=0x6600e0, code=0x7fffe4059210 "\216<8\367\377\177", storeJumpTable=0x0) at jsruntime/qv4vme_moth.cpp:508 #20 0x00007ffff7384160 in QV4::Moth::VME::exec (engine=0x6600e0, code=0x7fffe4058ff8 "i\001\070\367\377\177") at jsruntime/qv4vme_moth.cpp:968 #21 0x00007ffff7308cf6 in QV4::SimpleScriptFunction::call (that=0x7fffec494040, callData=0x7fffecab2318) at jsruntime/qv4functionobject.cpp:576 #22 0x00007ffff728271a in QV4::Object::call (this=0x7fffec494040, d=0x7fffecab2318) at /home/user/work/source/qt5.6.2/qt5/qtbase/include/QtQml/5.6.2/QtQml/private/../../../../../../qtdeclarative/src/qml/jsruntime/qv4object_p.h:326 #23 0x00007ffff744f9d4 in QQmlJavaScriptExpression::evaluate (this=0x7724a0, callData=0x7fffecab2318, isUndefined=0x0) at qml/qqmljavascriptexpression.cpp:189 #24 0x00007ffff73e1701 in QQmlBoundSignalExpression::evaluate (this=0x7724a0, a=0x0) at qml/qqmlboundsignal.cpp:240 #25 0x00007ffff73e1c7c in QQmlBoundSignal_callback (e=0x888f30, a=0x0) at qml/qqmlboundsignal.cpp:357 #26 0x00007ffff742e018 in QQmlNotifier::emitNotify (endpoint=0x0, a=0x0) at qml/qqmlnotifier.cpp:94 #27 0x00007ffff73b75d0 in QQmlData::signalEmitted (object=0x80d970, index=3, a=0x0) at qml/qqmlengine.cpp:772 #28 0x00007ffff6d923fa in QMetaObject::activate (sender=0x80d970, signalOffset=3, local_signal_index=0, argv=0x0) at kernel/qobject.cpp:3616 #29 0x00007ffff6d9220a in QMetaObject::activate (sender=0x80d970, m=0x7ffff7686c40 <QQmlTimer::staticMetaObject>, local_signal_index=0, argv=0x0) at kernel/qobject.cpp:3595 #30 0x00007ffff74d2017 in QQmlTimer::triggered (this=0x80d970) at .moc/moc_qqmltimer_p.cpp:260 #31 0x00007ffff74bca84 in QQmlTimer::ticked (this=0x80d970) at types/qqmltimer.cpp:317 #32 0x00007ffff74bcaf4 in QQmlTimer::event (this=0x80d970, e=0x678415b0) at types/qqmltimer.cpp:329 #33 0x00007ffff6d51208 in QCoreApplicationPrivate::notify_helper (receiver=0x80d970, event=0x678415b0) at kernel/qcoreapplication.cpp:1149 #34 0x00007ffff6d50e7e in doNotify (receiver=0x80d970, event=0x678415b0) at kernel/qcoreapplication.cpp:1090 #35 0x00007ffff6d50de2 in QCoreApplication::notify (this=0x7fffffffd900, receiver=0x80d970, event=0x678415b0) at kernel/qcoreapplication.cpp:1076 #36 0x00007ffff779ba4a in QGuiApplication::notify (this=0x7fffffffd900, object=0x80d970, event=0x678415b0) at kernel/qguiapplication.cpp:1616 #37 0x00007ffff6d50d5f in QCoreApplication::notifyInternal2 (receiver=0x80d970, event=0x678415b0) at kernel/qcoreapplication.cpp:1015 #38 0x00007ffff6d54f60 in QCoreApplication::sendEvent (receiver=0x80d970, event=0x678415b0) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:225 #39 0x00007ffff6d52157 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x60af10) at kernel/qcoreapplication.cpp:1650 #40 0x00007ffff6d51b18 in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at kernel/qcoreapplication.cpp:1508 #41 0x00007ffff6dcff0b in postEventSourceDispatch (s=0x652460) at kernel/qeventdispatcher_glib.cpp:270 #42 0x00007ffff4de6197 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #43 0x00007ffff4de63f0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #44 0x00007ffff4de649c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #45 0x00007ffff6dd06ec in QEventDispatcherGlib::processEvents (this=0x645e40, flags=...) at kernel/qeventdispatcher_glib.cpp:417 #46 0x00007ffff1dc79a2 in QPAEventDispatcherGlib::processEvents (this=0x645e40, flags=...) at eventdispatchers/qeventdispatcher_glib.cpp:115 #47 0x00007ffff6d4dd58 in QEventLoop::processEvents (this=0x7fffffffd860, flags=...) at kernel/qeventloop.cpp:128 #48 0x00007ffff6d4e057 in QEventLoop::exec (this=0x7fffffffd860, flags=...) at kernel/qeventloop.cpp:206 #49 0x00007ffff6d51509 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1285 #50 0x00007ffff779b9fa in QGuiApplication::exec () at kernel/qguiapplication.cpp:1607 #51 0x0000000000402533 in main (argc=1, argv=0x7fffffffda28) at ../LoaderCrash/main.cpp:13
Attachments
For Gerrit Dashboard: QTBUG-76932 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
267376,8 | QQmlObjectCreator: Do not delete objects not owned by engine | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |