Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-1676

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • None
    • 1.19.2
    • General
    • None
    • Qt 5.15.0, macOS m1 11.5.2
    • macOS
    • 389301dffd0ba7e02fa110aab7237296f5925f7e (qbs/qbs/1.20)

    Description

      I'm aware of some bugs related to qmlcache and inline components in 5.15.0. This one isn't reproducible under qmake (.pro file attached).

      There are 2 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.

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

      The qmake built example gets displayed on any run.

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

      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

        1. qbs.log
          11 kB
        2. qmake.log
          19 kB
        3. test.zip
          8 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kandeler Christian Kandeler
            mabean Max Bespalov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes