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

crash in tryLoadFromDiskCache with corrupted cache

    XMLWordPrintable

Details

    • Linux/Wayland, Linux/X11
    • 7a3db863f (dev), b47065e31 (6.6), fcbadf4e9 (6.5), 5710bcb81 (tqtc/lts-6.2)

    Description

      When the drive that houses the qml cache is full and an application gets launched the cache gets potentially truncated resulting in crashes whenever that cache is being loaded.

      I'm attaching an example that aids in generating a large enough cache. Using this the crash can easily be reproduced by running

      • qml test.qml
      • truncate -s 12288 $HOME/.cache/QtProject/Qml\ Runtime/qmlcache/*.qmlc
      • qml test.qml

      Downstream reports:

      #6  QV4::CompiledData::TypeReferenceMap::collectFromObject<QV4::CompiledData::Object> (obj=0x7f8dec0a8274, this=0x55cdc4461b08) at /usr/include/x86_64-linux-gnu/qt6/QtCore/qendian.h:258
      #7  QQmlTypeData::tryLoadFromDiskCache (this=0x55cdc44619e0) at ./src/qml/qml/qqmltypedata.cpp:112
      #8  QQmlTypeData::dataReceived (this=0x55cdc44619e0, data=...) at ./src/qml/qml/qqmltypedata.cpp:632
      #9  0x00007f8dfaf6962a in QQmlTypeLoader::setData (this=this@entry=0x55cdc448a230, blob=..., d=...) at ./src/qml/qml/qqmltypeloader.cpp:405
      #10 0x00007f8dfaf6a5f7 in QQmlTypeLoader::setData (this=this@entry=0x55cdc448a230, blob=..., fileName=...) at ./src/qml/qml/qqmltypeloader.cpp:395
      #11 0x00007f8dfaf6e66a in QQmlTypeLoader::loadThread (this=0x55cdc448a230, blob=...) at ./src/qml/qml/qqmltypeloader.cpp:260
      #12 0x00007f8dfaf7af09 in QQmlThread::createMessageFromMethod<void (QQmlTypeLoaderThread::*)(QQmlRefPointer<QQmlDataBlob> const&), QQmlRefPointer<QQmlDataBlob> const&>(void (QQmlTypeLoaderThread::*&&)(QQmlRefPointer<QQmlDataBlob> const&), QQmlRefPointer<QQmlDataBlob> const&)::I::call(QQmlThread*) () at /usr/include/c++/11/bits/invoke.h:74
      #13 0x00007f8dfae6ceaf in QQmlThreadPrivate::threadEvent (this=0x55cdc4426100) at ./src/qml/qml/ftw/qqmlthread.cpp:148
      #14 QQmlThreadPrivate::event (this=0x55cdc4426100, e=0x55cdc458aa80) at ./src/qml/qml/ftw/qqmlthread.cpp:105
      #15 0x00007f8df975a3d8 in QCoreApplication::notifyInternal2 (receiver=0x55cdc4426100, event=0x55cdc458aa80) at ./src/corelib/kernel/qcoreapplication.cpp:1118
      #16 0x00007f8df975e408 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x55cdc4487ee0) at ./src/corelib/kernel/qcoreapplication.cpp:1898
      #17 0x00007f8df99b67b7 in postEventSourceDispatch (s=0x7f8dc80047f0) at ./src/corelib/kernel/qeventdispatcher_glib.cpp:243
      #18 0x00007f8df8bdbd3b in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
      #19 0x00007f8df8c31258 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
      #20 0x00007f8df8bd93e3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
      #21 0x00007f8df99b601e in QEventDispatcherGlib::processEvents (this=0x7f8dc8000b70, flags=...) at ./src/corelib/kernel/qeventdispatcher_glib.cpp:393
      #22 0x00007f8df9767053 in QEventLoop::exec (this=this@entry=0x7f8dd8af6b50, flags=..., flags@entry=...) at ./src/corelib/global/qflags.h:34
      #23 0x00007f8df9844150 in QThread::exec (this=<optimized out>) at ./src/corelib/global/qflags.h:74
      #24 0x00007f8df98cf01c in operator() (__closure=<optimized out>, __closure=<optimized out>) at ./src/corelib/thread/qthread_unix.cpp:324
      #25 (anonymous namespace)::terminate_on_exception<QThreadPrivate::start(void*)::<lambda()> > (t=..., t=...) at ./src/corelib/thread/qthread_unix.cpp:260
      #26 QThreadPrivate::start (arg=0x55cdc4426100) at ./src/corelib/thread/qthread_unix.cpp:283
      #27 0x00007f8df8e94b43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #28 0x00007f8df8f26a00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      Attachments

        1. test.qml
          21 kB
          Harald Sitter
        For Gerrit Dashboard: QTBUG-117130
        # Subject Branch Project Status CR V

        Activity

          People

            fabiankosmale Fabian Kosmale
            apachelogger Harald Sitter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes