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

qmlcache causes loading problem if the qml filename matches the name of some qml file from Qt package and has inline component

    XMLWordPrintable

Details

    • All
    • 963623609d43a6f4087443f6992be14d2bc0900d (qt/qtdeclarative/dev) 1baa623122702bfd11affce622993747a9fe941f (qt/tqtc-qtdeclarative/5.15) 2343141664bb9d6f1f1d81582cd726060f500768 (qt/qtdeclarative/6.2)

    Description

      There are 3 conditions:
      1. Your qml filename must match the name of some component from Qt package (like ToolBar from QtQuick.Controls 2).
      2. This qml file must include inline component.
      3. Qt quick compiler is disabled

      The attached example stuck on second run, view doesn't get displayed. Removing qmlcache fixes it for one time.

      Talking about the real project, we get a crash in a qml thread on the view loading:

      Thread 33 Crashed:: QQmlThread
      0   org.qt-project.QtQml          	0x000000010e9d60f1 QQmlTypeData::buildTypeResolutionCaches(QQmlRefPointer<QQmlTypeNameCache>*, QV4::ResolvedTypeReferenceMap*) const + 2129
      1   org.qt-project.QtQml          	0x000000010e9d3dcc QQmlTypeData::done() + 2156
      2   org.qt-project.QtQml          	0x000000010e9c7bd1 QQmlDataBlob::tryDone() + 65
      3   org.qt-project.QtQml          	0x000000010ea23f55 QQmlTypeLoader::setData(QQmlDataBlob*, QQmlDataBlob::SourceCodeData const&) + 149
      4   org.qt-project.QtQml          	0x000000010ea2378b QQmlTypeLoader::setData(QQmlDataBlob*, QString const&) + 107
      5   org.qt-project.QtQml          	0x000000010ea235c2 QQmlTypeLoader::loadThread(QQmlDataBlob*) + 338
      6   org.qt-project.QtQml          	0x000000010ea22e8c void QQmlTypeLoader::doLoad<PlainLoader>(PlainLoader const&, QQmlDataBlob*, QQmlTypeLoader::Mode) + 60
      7   org.qt-project.QtQml          	0x000000010ea26d5a QQmlTypeLoader::getType(QUrl const&, QQmlTypeLoader::Mode) + 442
      8   org.qt-project.QtQml          	0x000000010e9d8c23 QQmlTypeData::resolveTypes() + 2435
      9   org.qt-project.QtQml          	0x000000010e9d8217 QQmlTypeData::allDependenciesDone() + 615
      10  org.qt-project.QtQml          	0x000000010ea23f1c QQmlTypeLoader::setData(QQmlDataBlob*, QQmlDataBlob::SourceCodeData const&) + 92
      11  org.qt-project.QtQml          	0x000000010ea2378b QQmlTypeLoader::setData(QQmlDataBlob*, QString const&) + 107
      12  org.qt-project.QtQml          	0x000000010ea235c2 QQmlTypeLoader::loadThread(QQmlDataBlob*) + 338
      13  org.qt-project.QtQml          	0x000000010ea22e8c void QQmlTypeLoader::doLoad<PlainLoader>(PlainLoader const&, QQmlDataBlob*, QQmlTypeLoader::Mode) + 60
      14  org.qt-project.QtQml          	0x000000010ea26d5a QQmlTypeLoader::getType(QUrl const&, QQmlTypeLoader::Mode) + 442
      15  org.qt-project.QtQml          	0x000000010e9d8c23 QQmlTypeData::resolveTypes() + 2435
      16  org.qt-project.QtQml          	0x000000010e9d8217 QQmlTypeData::allDependenciesDone() + 615
      17  org.qt-project.QtQml          	0x000000010ea23f1c QQmlTypeLoader::setData(QQmlDataBlob*, QQmlDataBlob::SourceCodeData const&) + 92
      18  org.qt-project.QtQml          	0x000000010ea2378b QQmlTypeLoader::setData(QQmlDataBlob*, QString const&) + 107
      19  org.qt-project.QtQml          	0x000000010ea235c2 QQmlTypeLoader::loadThread(QQmlDataBlob*) + 338
      20  org.qt-project.QtQml          	0x000000010e9e1ec2 QQmlTypeLoaderThread::loadThread(QQmlDataBlob*) + 18
      21  org.qt-project.QtQml          	0x000000010ea9a882 QQmlThreadPrivate::threadEvent() + 98
      22  org.qt-project.QtQml          	0x000000010ea9a810 QQmlThreadPrivate::event(QEvent*) + 32
      23  org.qt-project.QtWidgets      	0x000000010f84440c QApplicationPrivate::notify_helper(QObject*, QEvent*) + 268
      24  org.qt-project.QtWidgets      	0x000000010f8458ac QApplication::notify(QObject*, QEvent*) + 588
      25  org.qt-project.QtCore         	0x000000010be89fd4 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 212
      26  org.qt-project.QtCore         	0x000000010be8b277 QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) + 759
      27  org.qt-project.QtCore         	0x000000010beed4b9 QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 73
      28  org.qt-project.QtCore         	0x000000010be85fff QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 431
      29  org.qt-project.QtCore         	0x000000010bcb3e03 QThread::exec() + 131
      30  org.qt-project.QtQml          	0x000000010ea9a929 QQmlThreadPrivate::run() + 57
      31  org.qt-project.QtCore         	0x000000010bcb4e19 QThreadPrivate::start(void*) + 329
      32  libsystem_pthread.dylib       	0x00007fff203e68fc _pthread_start + 224
      33  libsystem_pthread.dylib       	0x00007fff203e2443 thread_start + 15
      

      Found similar stacktrace (https://bugreports.qt.io/browse/QTBUG-92236), but the last function is different. Haven't found crashes and bugs related to QQmlTypeData::buildTypeResolutionCaches.

      Attachments

        For Gerrit Dashboard: QTBUG-96796
        # Subject Branch Project Status CR V

        Activity

          People

            ulherman Ulf Hermann
            mabean Max Bespalov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes