Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.3.0
-
None
-
ae6f73e8566fa76470937aca737141183929a5ec (qt/qtbase/5.14.2)
Description
QLibraryStore::findOrCreate is mutex-protected, but the caller (QPluginLoader::setFileName) then calls d->loadHints = lh and other setters on "d", which race with other theads, if the same plugin is loaded from multiple threads.
==14794== ==14794== Possible data race during write of size 4 at 0xF5EAAC0 by thread #21 ==14794== Locks held: none ==14794== at 0x6633F78: QPluginLoader::setFileName(QString const&) (qpluginloader.cpp:356) ==14794== by 0x6633230: QPluginLoader::QPluginLoader(QString const&, QObject*) (qpluginloader.cpp:158) ==14794== by 0x5EBEBE7: KPluginLoader::findPlugin(QString const&) (kpluginloader.cpp:59) ==14794== by 0x4ED91DB: KIO::Slave::createSlave(QString const&, QUrl const&, int&, QString&) (slave.cpp:461) ==14794== ==14794== This conflicts with a previous write of size 4 by thread #12 ==14794== Locks held: none ==14794== at 0x6633F78: QPluginLoader::setFileName(QString const&) (qpluginloader.cpp:356) ==14794== by 0x6633230: QPluginLoader::QPluginLoader(QString const&, QObject*) (qpluginloader.cpp:158) ==14794== by 0x5EBEBE7: KPluginLoader::findPlugin(QString const&) (kpluginloader.cpp:59) ==14794== by 0x4ED91DB: KIO::Slave::createSlave(QString const&, QUrl const&, int&, QString&) (slave.cpp:461)
Should the QLibraryStore be turned into a QThreadStorage, i.e. one store per thread?
Attachments
Issue Links
- relates to
-
QTBUG-41107 QImageReader::supportedImageFormats() leads to overwritten memory and crashes when used from a thread
-
- Closed
-