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

Crash in QTranslatorPrivate::do_translate (QQmlThread) after QTranslator::load (main thread)

    XMLWordPrintable

Details

    • Linux/Wayland

    Description

      We have a low frequency crash in production caused by simultaneously loading a QML module and loading translations. Two variants of this crash appear in two different places in QQmlThread (see below).

      Common to both crashes are that they happened after two successive calls to QTranslator::load using the same translation file. We can't reproduce this in isolation, but maybe the developers who know QTranslator internally can share if they consider it being thread safe to call QCoreApplication::translate, either directly or indirectly through use of qt_error_string, while QTranslator::load is called in the main thread?

      #0  0x0000ffff9b004208 in (/lib/libQt6Core.so.6.5.6 @ 0x001c4208) QTranslatorPrivate::do_translate(char const*, char const*, char const*, int) const() + 0x458
      #1  0x0000ffff9b004890 in (/lib/libQt6Core.so.6.5.6 @ 0x001c4890) QTranslator::translate(char const*, char const*, char const*, int) const() + 0x30
      #2  0x0000ffff9af8cf7c in (/lib/libQt6Core.so.6.5.6 @ 0x0014cf7c) QCoreApplication::translate(char const*, char const*, char const*, int)() + 0x30c
      #3  0x0000ffff9b985460 in (/lib/libQt6Qml.so.6.5.6 @ 0x00325460) QQmlImportNamespace::resolveType(QQmlTypeLoader*, QHashedStringRef const&, QTypeRevision*, QQmlType*, QString const*, QList<QQmlError>*, QQmlType::RegistrationType, bool*)() + 0x380
      #4  0x0000ffff9b9859e8 in (/lib/libQt6Qml.so.6.5.6 @ 0x003259e8) QQmlImports::resolveType(QHashedStringRef const&, QTypeRevision*, QQmlType*, QList<QQmlError>*, QQmlType::RegistrationType, bool*) const() + 0xa8
      #5  0x0000ffff9b986370 in (/lib/libQt6Qml.so.6.5.6 @ 0x00326370) QQmlImports::resolveType(QHashedStringRef const&, QQmlType*, QTypeRevision*, QQmlImportNamespace**, QList<QQmlError>*, QQmlType::RegistrationType, bool*) const() + 0xc0
      #6  0x0000ffff9ba31fcc in (/lib/libQt6Qml.so.6.5.6 @ 0x003d1fcc) QQmlTypeData::resolveType(QString const&, QTypeRevision&, QQmlTypeData::TypeReference&, int, int, bool, QQmlType::RegistrationType, bool*)() + 0xac
      #7  0x0000ffff9ba32d3c in (/lib/libQt6Qml.so.6.5.6 @ 0x003d2d3c) QQmlTypeData::resolveTypes()() + 0x71c
      #8  0x0000ffff9ba3602c in (/lib/libQt6Qml.so.6.5.6 @ 0x003d602c) QQmlTypeData::allDependenciesDone()() + 0x20c
      #9  0x0000ffff9ba42b18 in (/lib/libQt6Qml.so.6.5.6 @ 0x003e2b18) QQmlTypeLoader::setData(QQmlRefPointer<QQmlDataBlob> const&, QQmlDataBlob::SourceCodeData const&)() + 0xd8
      #10 0x0000ffff9ba42cec in (/lib/libQt6Qml.so.6.5.6 @ 0x003e2cec) QQmlTypeLoader::setData(QQmlRefPointer<QQmlDataBlob> const&, QString const&)() + 0x8c
      #11 0x0000ffff9ba47310 in (/lib/libQt6Qml.so.6.5.6 @ 0x003e7310) QQmlTypeLoader::loadThread(QQmlRefPointer<QQmlDataBlob> const&)() + 0xd0
      #12 0x0000ffff9ba53878 in (/lib/libQt6Qml.so.6.5.6 @ 0x003f3878) QQmlThread::createMessageFromMethod<void (QQmlTypeLoaderThread::*)(QQmlRefPointer<QQmlDataBlob> const&), QQmlRefPointer<QQmlDataBlob> const&>(void (QQmlTypeLoaderThread::*&&)(QQmlRefPointer<QQmlDataBlob> const&), QQmlRefPointer<QQmlDataBlob> const&)::I::call(QQmlThread*)() + 0x68
      #13 0x0000ffff9b917298 in (/lib/libQt6Qml.so.6.5.6 @ 0x002b7298) QQmlThreadPrivate::threadEvent()() + 0x78
      #14 0x0000ffff9b917d24 in (/lib/libQt6Qml.so.6.5.6 @ 0x002b7d24) QQmlThreadPrivate::event(QEvent*)() + 0x34
      #15 0x0000ffff9af8b7a4 in (/lib/libQt6Core.so.6.5.6 @ 0x0014b7a4) QCoreApplication::notifyInternal2(QObject*, QEvent*)() + 0x144
      #16 0x0000ffff9af8f338 in (/lib/libQt6Core.so.6.5.6 @ 0x0014f338) QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*)() + 0x328
      #17 0x0000ffff9b132850 in (/lib/libQt6Core.so.6.5.6 @ 0x002f2850) QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)() + 0x60
      #18 0x0000ffff9af9821c in (/lib/libQt6Core.so.6.5.6 @ 0x0015821c) QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)() + 0x19c
      #19 0x0000ffff9b0bb4e4 in (/lib/libQt6Core.so.6.5.6 @ 0x0027b4e4) QThread::exec()() + 0xa4
      #20 0x0000ffff9b137620 in (/lib/libQt6Core.so.6.5.6 @ 0x002f7620) QThreadPrivate::start(void*)() + 0x150
      

      Here's another:

      #0  0x0000ffffac7c4284 in (/lib/libQt6Core.so.6.5.6 @ 0x001c4284) QTranslatorPrivate::do_translate(char const*, char const*, char const*, int) const() + 0x4d4
      #1  0x0000ffffac7c4890 in (/lib/libQt6Core.so.6.5.6 @ 0x001c4890) QTranslator::translate(char const*, char const*, char const*, int) const() + 0x30
      #2  0x0000ffffac74cf7c in (/lib/libQt6Core.so.6.5.6 @ 0x0014cf7c) QCoreApplication::translate(char const*, char const*, char const*, int)() + 0x30c
      #3  0x0000ffffac6d4ff4 in (/lib/libQt6Core.so.6.5.6 @ 0x000d4ff4) qt_error_string(int)() + 0xe8
      #4  0x0000ffffad27d5d8 in (/lib/libQt6Qml.so.6.5.6 @ 0x0045d5d8) QV4::CompilationUnitMapper::open(QString const&, QDateTime const&, QString*)() + 0x268
      #5  0x0000ffffacfb6d84 in (/lib/libQt6Qml.so.6.5.6 @ 0x00196d84) QV4::CompilationUnitMapper::get(QString const&, QDateTime const&, QString*)() + 0x204
      #6  0x0000ffffacff3924 in (/lib/libQt6Qml.so.6.5.6 @ 0x001d3924) QV4::ExecutableCompilationUnit::loadFromDisk(QUrl const&, QDateTime const&, QString*)() + 0x194
      #7  0x0000ffffad1f12a8 in (/lib/libQt6Qml.so.6.5.6 @ 0x003d12a8) QQmlTypeData::tryLoadFromDiskCache()() + 0xd8
      

      Attachments

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

        Activity

          People

            kkohne Kai Köhne
            andrhans Andreas Aardal Hanssen
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change