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

Crash while loading QML type data from disk cache

    XMLWordPrintable

Details

    • All
    • 0645cf8e30e2311cc3d90cc2cb7abc7a27e91624 (qt/qtdeclarative/dev) 6630713366f86fc757eadc1ea41cd72602d88f86 (qt/qtdeclarative/6.2) 0e5cb85a1021815c1a3d38a67e936d90b59ddf45 (qt/tqtc-qtdeclarative/5.15)

    Description

      Following crash happened:

      Unhandled exception thrown: read access violation.
      *this* was 0x2321D02006C.

      Callstack:

      >	Qt6Qmld.dll!QSpecialInteger<QLittleEndianStorageType<unsigned int>>::operator unsigned int() Line 273	C++
       	Qt6Qmld.dll!QV4::CompilationUnitMapper::close() Line 116	C++
       	Qt6Qmld.dll!QV4::CompilationUnitMapper::~CompilationUnitMapper() Line 83	C++
       	[External Code]	
       	Qt6Qmld.dll!QHashPrivate::Span<QHashPrivate::Node<QString,QV4::CompilationUnitMapper>>::addStorage() Line 445	C++
       	Qt6Qmld.dll!QHashPrivate::Span<QHashPrivate::Node<QString,QV4::CompilationUnitMapper>>::insert(unsigned __int64 i) Line 338	C++
       	Qt6Qmld.dll!QHashPrivate::Data<QHashPrivate::Node<QString,QV4::CompilationUnitMapper>>::findOrInsert(const QString & key) Line 637	C++
       	Qt6Qmld.dll!QHash<QString,QV4::CompilationUnitMapper>::emplace<QV4::CompilationUnitMapper const &>(QString && key, const QV4::CompilationUnitMapper & <args_0>) Line 1180	C++
       	Qt6Qmld.dll!QHash<QString,QV4::CompilationUnitMapper>::emplace<QV4::CompilationUnitMapper const &>(const QString & key, const QV4::CompilationUnitMapper & <args_0>) Line 1171	C++
       	Qt6Qmld.dll!QHash<QString,QV4::CompilationUnitMapper>::insert(const QString & key, const QV4::CompilationUnitMapper & value) Line 1149	C++
       	Qt6Qmld.dll!StaticUnitCache::set(const QString & file, const QV4::CompilationUnitMapper & staticUnit) Line 66	C++
       	Qt6Qmld.dll!QV4::CompilationUnitMapper::get(const QString & cacheFilePath, const QDateTime & sourceTimeStamp, QString * errorString) Line 105	C++
       	Qt6Qmld.dll!QV4::ExecutableCompilationUnit::loadFromDisk(const QUrl & url, const QDateTime & sourceTimeStamp, QString * errorString) Line 821	C++
       	Qt6Qmld.dll!QQmlTypeData::tryLoadFromDiskCache() Line 146	C++
       	Qt6Qmld.dll!QQmlTypeData::dataReceived(const QQmlDataBlob::SourceCodeData & data) Line 576	C++
       	Qt6Qmld.dll!QQmlTypeLoader::setData(QQmlDataBlob * blob, const QQmlDataBlob::SourceCodeData & d) Line 447	C++
       	Qt6Qmld.dll!QQmlTypeLoader::setData(QQmlDataBlob * blob, const QString & fileName) Line 436	C++
       	Qt6Qmld.dll!QQmlTypeLoader::loadThread(QQmlDataBlob * blob) Line 299	C++
       	Qt6Qmld.dll!PlainLoader::loadThread(QQmlTypeLoader * loader, QQmlDataBlob * blob) Line 145	C++
       	Qt6Qmld.dll!QQmlTypeLoader::doLoad<PlainLoader>(const PlainLoader & loader, QQmlDataBlob * blob, QQmlTypeLoader::Mode mode) Line 204	C++
       	Qt6Qmld.dll!QQmlTypeLoader::load(QQmlDataBlob * blob, QQmlTypeLoader::Mode mode) Line 236	C++
       	Qt6Qmld.dll!QQmlTypeLoader::getType(const QUrl & unNormalizedUrl, QQmlTypeLoader::Mode mode) Line 868	C++
       	Qt6Qmld.dll!QQmlTypeData::resolveTypes() Line 867	C++
       	Qt6Qmld.dll!QQmlTypeData::allDependenciesDone() Line 742	C++
       	Qt6Qmld.dll!QQmlTypeLoader::setData(QQmlDataBlob * blob, const QQmlDataBlob::SourceCodeData & d) Line 450	C++
       	Qt6Qmld.dll!QQmlTypeLoader::setData(QQmlDataBlob * blob, const QString & fileName) Line 436	C++
       	Qt6Qmld.dll!QQmlTypeLoader::loadThread(QQmlDataBlob * blob) Line 299	C++
       	Qt6Qmld.dll!PlainLoader::loadThread(QQmlTypeLoader * loader, QQmlDataBlob * blob) Line 145	C++
       	Qt6Qmld.dll!QQmlTypeLoader::doLoad<PlainLoader>(const PlainLoader & loader, QQmlDataBlob * blob, QQmlTypeLoader::Mode mode) Line 204	C++
       	Qt6Qmld.dll!QQmlTypeLoader::load(QQmlDataBlob * blob, QQmlTypeLoader::Mode mode) Line 236	C++
       	Qt6Qmld.dll!QQmlTypeLoader::getType(const QUrl & unNormalizedUrl, QQmlTypeLoader::Mode mode) Line 868	C++
       	Qt6Qmld.dll!QQmlTypeData::resolveTypes() Line 867	C++
       	Qt6Qmld.dll!QQmlTypeData::allDependenciesDone() Line 742	C++
       	Qt6Qmld.dll!QQmlTypeLoader::setData(QQmlDataBlob * blob, const QQmlDataBlob::SourceCodeData & d) Line 450	C++
       	Qt6Qmld.dll!QQmlTypeLoader::setData(QQmlDataBlob * blob, const QString & fileName) Line 436	C++
       	Qt6Qmld.dll!QQmlTypeLoader::loadThread(QQmlDataBlob * blob) Line 299	C++
       	Qt6Qmld.dll!QQmlTypeLoaderThread::loadThread(QQmlDataBlob * b) Line 163	C++
       	Qt6Qmld.dll!`QQmlThread::callMethodInThread<QQmlDataBlob *,QQmlDataBlob *,QQmlTypeLoaderThread>'::`2'::I::call(QQmlThread * thread) Line 165	C++
       	Qt6Qmld.dll!QQmlThreadPrivate::threadEvent() Line 200	C++
       	Qt6Qmld.dll!QQmlThreadPrivate::event(QEvent * e) Line 143	C++
       	Qt6Widgetsd.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3396	C++
       	Qt6Widgetsd.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 2758	C++
       	Qt6Cored.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Line 1063	C++
       	Qt6Cored.dll!QCoreApplication::sendEvent(QObject * receiver, QEvent * event) Line 1472	C++
       	Qt6Cored.dll!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver, int event_type, QThreadData * data) Line 1830	C++
       	Qt6Cored.dll!QEventDispatcherWin32::sendPostedEvents() Line 904	C++
       	Qt6Cored.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 474	C++
       	Qt6Cored.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 140	C++
       	Qt6Cored.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 232	C++
       	Qt6Cored.dll!QThread::exec() Line 544	C++
       	Qt6Qmld.dll!QQmlThreadPrivate::run() Line 156	C++
       	Qt6Cored.dll!QThreadPrivate::start(void * arg) Line 329	C++
       	[External Code]	
      

      I investigated the code and started wondering how the StaticUnitCache stores CompilationUnitMapper instances in QHash<QString, CompilationUnitMapper> and the destructor of CompilationUnitMapper closes the mmapped file?

      CompilationUnitMapper::~CompilationUnitMapper()
      {
          close();
      }
      

      QHash may call node destructor during insertion, for example.

      Attachments

        1. Qt6Qmld.7z
          9.00 MB
        2. qmlc from the initial crash.png
          qmlc from the initial crash.png
          69 kB
        3. myapp.exe.7920.dmp
          1.43 MB
        4. myapp.exe.6588.dmp
          1003 kB
        For Gerrit Dashboard: QTBUG-96275
        # Subject Branch Project Status CR V

        Activity

          People

            jakoivik Jarkko Koivikko
            jakoivik Jarkko Koivikko
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes