Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-25301

Creator uses QIcons in non-gui threads

    XMLWordPrintable

    Details

    • Commits:
      bce81fd9927eb8540c0029306ad87fcaa4a811ca

      Description

      QIcon shouldn't be created in non-gui thread.

      It happened, that creator crashed during a session switch, and one of the threads revealed an attempt to create a QIcon in non-gui thread:

      Thread 13 (Thread 0x7ff0963ed640 (LWP 103513)):
      #0  QArrayData::allocate (objectSize=1, alignment=8, capacity=10, options=...) at /home/jarek/dev/qt-515/qtbase/src/corelib/tools/qarraydata.cpp:197
      #1  0x00007ff0e4809e05 in QTypedArrayData<char>::allocate (capacity=10, options=...) at ../../include/QtCore/../../../../qt-515/qtbase/src/corelib/tools/qarraydata.h:224
      #2  0x00007ff0e4803dc5 in QByteArray::resize (this=0x7ff05b5033b8, size=9) at /home/jarek/dev/qt-515/qtbase/src/corelib/text/qbytearray.cpp:1800
      #3  0x00007ff0e4a69f20 in QCborContainerPrivate::addByteData (this=0x7ff05b5033b0, block=0x7ff0e4c09569 "debug", len=5) at /home/jarek/dev/qt-515/qtbase/src/corelib/serialization/qcborvalue_p.h:164
      #4  0x00007ff0e4a6a47f in QCborContainerPrivate::appendByteData (this=0x7ff05b5033b0, data=0x7ff0e4c09569 "debug", len=5, type=QCborValue::String, extraFlags=...) at /home/jarek/dev/qt-515/qtbase/src/corelib/serialization/qcborvalue_p.h:244
      #5  0x00007ff0e4a6a566 in QCborContainerPrivate::append (this=0x7ff05b5033b0, s=...) at /home/jarek/dev/qt-515/qtbase/src/corelib/serialization/qcborvalue_p.h:252
      #6  0x00007ff0e4a63069 in QCborValue::QCborValue (this=0x7ff0963eb670, s=...) at /home/jarek/dev/qt-515/qtbase/src/corelib/serialization/qcborvalue.cpp:1765
      #7  0x00007ff0e4a79640 in QJsonObject::insertAt<QLatin1String> (this=0x7ff0963eb7d0, pos=0, key=..., value=..., keyExists=false) at /home/jarek/dev/qt-515/qtbase/src/corelib/serialization/qjsonobject.cpp:536
      #8  0x00007ff0e4a78ab0 in QJsonObject::insertImpl<QLatin1String> (this=0x7ff0963eb7d0, key=..., value=...) at /home/jarek/dev/qt-515/qtbase/src/corelib/serialization/qjsonobject.cpp:519
      #9  0x00007ff0e4a76b07 in QJsonObject::insert (this=0x7ff0963eb7d0, key=..., value=...) at /home/jarek/dev/qt-515/qtbase/src/corelib/serialization/qjsonobject.cpp:504
      #10 0x00007ff0e49ad83b in jsonFromCborMetaData (raw=0x7ff0be923950 <qt_pluginMetaData+16> "\277\002x4org.qt-project.Qt.QDesignerFormEditorPluginInterface\003vSignalSlotEditorPlugin\377", size=2147483631, errMsg=0x7ff0963eba58) at /home/jarek/dev/qt-515/qtbase/src/corelib/plugin/qfactoryloader.cpp:99
      #11 0x00007ff0e49ade9a in qJsonFromRawLibraryMetaData (raw=0x7ff0be92394c <qt_pluginMetaData+12> "", sectionSize=2147483635, errMsg=0x7ff0963eba58) at /home/jarek/dev/qt-515/qtbase/src/corelib/plugin/qfactoryloader.cpp:151
      #12 0x00007ff0e49abdef in QStaticPlugin::metaData (this=0x92ee98) at /home/jarek/dev/qt-515/qtbase/src/corelib/plugin/qpluginloader.cpp:494
      #13 0x00007ff0e49af5d9 in QFactoryLoader::metaData (this=0x7ff0e59348e0 <QImageReaderWriterHelpers::(anonymous namespace)::Q_QGS_loader::innerFunction()::holder>) at /home/jarek/dev/qt-515/qtbase/src/corelib/plugin/qfactoryloader.cpp:378
      #14 0x00007ff0e49afade in QFactoryLoader::keyMap (this=0x7ff0e59348e0 <QImageReaderWriterHelpers::(anonymous namespace)::Q_QGS_loader::innerFunction()::holder>) at /home/jarek/dev/qt-515/qtbase/src/corelib/plugin/qfactoryloader.cpp:424
      #15 0x00007ff0e51e2bdc in createReadHandlerHelper (device=0x7ff05b4e7970, format=..., autoDetectImageFormat=true, ignoresFormatAndExtension=false) at /home/jarek/dev/qt-515/qtbase/src/gui/image/qimagereader.cpp:196
      #16 0x00007ff0e51e435a in QImageReaderPrivate::initHandler (this=0x7ff05b508230) at /home/jarek/dev/qt-515/qtbase/src/gui/image/qimagereader.cpp:574
      #17 0x00007ff0e51e468c in QImageReader::format (this=0x7ff0963ebfe0) at /home/jarek/dev/qt-515/qtbase/src/gui/image/qimagereader.cpp:664
      #18 0x00007ff0e5205333 in (anonymous namespace)::ImageReader::format (this=0x7ff0963ebfe0) at /home/jarek/dev/qt-515/qtbase/src/gui/image/qicon.cpp:404
      #19 0x00007ff0e5205543 in QPixmapIconEngine::addFile (this=0x7ff081fdaaf0, fileName=..., size=..., mode=QIcon::Normal, state=QIcon::Off) at /home/jarek/dev/qt-515/qtbase/src/gui/image/qicon.cpp:432
      #20 0x00007ff0e5206f04 in QIcon::addFile (this=0x7ff0963ec240, fileName=..., size=..., mode=QIcon::Normal, state=QIcon::Off) at /home/jarek/dev/qt-515/qtbase/src/gui/image/qicon.cpp:1102
      #21 0x00007ff0e52061c6 in QIcon::QIcon (this=0x7ff0963ec240, fileName=...) at /home/jarek/dev/qt-515/qtbase/src/gui/image/qicon.cpp:728
      #22 0x00007ff0bcec6ee8 in CMakeProjectManager::Internal::CMakeTargetNode::CMakeTargetNode (this=0x7ff05b506ff0, directory=..., target=...) at /home/jarek/dev/creator-master/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp:88
      #23 0x00007ff0bcf341c3 in std::make_unique<CMakeProjectManager::Internal::CMakeTargetNode, Utils::FilePath const&, QString const&> () at /usr/include/c++/10/bits/unique_ptr.h:962
      #24 0x00007ff0bcf3196c in CMakeProjectManager::Internal::createTargetNode (cmakeListsNodes=..., dir=..., displayName=...) at /home/jarek/dev/creator-master/src/plugins/cmakeprojectmanager/projecttreehelper.cpp:168
      #25 0x00007ff0bcef3022 in (anonymous namespace)::addTargets (cmakeListsNodes=..., config=..., targetDetails=std::vector of length 429, capacity 512 = {...}, topSourceDir=..., sourceDir=..., buildDir=..., knownHeaderNodes=...) at /home/jarek/dev/creator-master/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp:567
      #26 0x00007ff0bcef33fa in (anonymous namespace)::generateRootProjectNode (data=..., sourceDirectory=..., buildDirectory=...) at /home/jarek/dev/creator-master/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp:600
      #27 0x00007ff0bcef3e24 in CMakeProjectManager::Internal::extractData (input=..., sourceDirectory=..., buildDirectory=...) at /home/jarek/dev/creator-master/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp:694
      #28 0x00007ff0bcf2bdd8 in operator() (__closure=0x263a550) at /home/jarek/dev/creator-master/src/plugins/cmakeprojectmanager/fileapireader.cpp:268
      #29 0x00007ff0bcf2e1d5 in Utils::Internal::runAsyncReturnVoidDispatch<CMakeProjectManager::Internal::FileApiQtcData*, CMakeProjectManager::Internal::FileApiReader::endState(const QFileInfo&)::<lambda()> >(std::false_type, QFutureInterface<CMakeProjectManager::Internal::FileApiQtcData*>, struct {...} &&) (futureInterface=..., function=...) at /home/jarek/dev/creator-master/src/libs/utils/runextensions.h:250
      #30 0x00007ff0bcf2e17d in Utils::Internal::runAsyncQFutureInterfaceDispatch<CMakeProjectManager::Internal::FileApiQtcData*, CMakeProjectManager::Internal::FileApiReader::endState(const QFileInfo&)::<lambda()> >(std::false_type, QFutureInterface<CMakeProjectManager::Internal::FileApiQtcData*>, struct {...} &&) (futureInterface=..., function=...) at /home/jarek/dev/creator-master/src/libs/utils/runextensions.h:264
      #31 0x00007ff0bcf2e0f3 in Utils::Internal::runAsyncMemberDispatch<CMakeProjectManager::Internal::FileApiQtcData*, CMakeProjectManager::Internal::FileApiReader::endState(const QFileInfo&)::<lambda()> >(QFutureInterface<CMakeProjectManager::Internal::FileApiQtcData*>, struct {...} &&) (futureInterface=..., function=...) at /home/jarek/dev/creator-master/src/libs/utils/runextensions.h:274
      #32 0x00007ff0bcf2e069 in Utils::Internal::runAsyncImpl<CMakeProjectManager::Internal::FileApiQtcData*, CMakeProjectManager::Internal::FileApiReader::endState(const QFileInfo&)::<lambda()> >(QFutureInterface<CMakeProjectManager::Internal::FileApiQtcData*>, struct {...} &&) (futureInterface=..., function=...) at /home/jarek/dev/creator-master/src/libs/utils/runextensions.h:303
      #33 0x00007ff0bcf2df98 in Utils::Internal::AsyncJob<CMakeProjectManager::Internal::FileApiQtcData*, CMakeProjectManager::Internal::FileApiReader::endState(const QFileInfo&)::<lambda()> >::runHelper<0>(std::index_sequence) (this=0x263a540) at /home/jarek/dev/creator-master/src/libs/utils/runextensions.h:372
      #34 0x00007ff0bcf2debe in Utils::Internal::AsyncJob<CMakeProjectManager::Internal::FileApiQtcData*, CMakeProjectManager::Internal::FileApiReader::endState(const QFileInfo&)::<lambda()> >::run(void) (this=0x263a540) at /home/jarek/dev/creator-master/src/libs/utils/runextensions.h:352
      #35 0x00007ff0e475e1d1 in QThreadPoolThread::run (this=0x29d5e60) at /home/jarek/dev/qt-515/qtbase/src/corelib/thread/qthreadpool.cpp:100
      #36 0x00007ff0e475830e in QThreadPrivate::start (arg=0x29d5e60) at /home/jarek/dev/qt-515/qtbase/src/corelib/thread/qthread_unix.cpp:329
      #37 0x00007ff0e39f03f9 in start_thread () from /lib64/libpthread.so.0
      #38 0x00007ff0e425c903 in clone () from /lib64/libc.so.6
      

      Not 100% sure if this thread caused a crash, but it looks like a potential reason for the crash.

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              con Eike Ziller
              Reporter:
              jkobus Jarek Kobus
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes