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

Race condition initializing qt config

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Invalid
    • Affects Version/s: 5.12.3
    • Fix Version/s: None
    • Component/s: Core: I/O
    • Labels:
      None
    • Environment:
      Visual Studio 2017
      CMake (>=3.5)
      Qt 5.12.3
    • Platform/s:
      Windows

      Description

      After updating Qt from 5.9 to 5.12.3 I started getting race condition while reading qt.conf

       

      Repro steps:

      1. Create "qt.conf" file next to executable with valid configuration

      2. The executable needs to start a QThread before creating an application:

      int main(int argc, char** argv) {
      	BackgroundThread thread{};
      	thread.start();
      
      	Application app(argc, argv);
      	return app.run();
      }
      

      3. The thread needs to use "qDebug()".

      class BackgroundThread : public QThread {
      	Q_OBJECT
      public:
      	void run() override {
      		qDebug() << "test";
      	}
      };
      

       

      After running the executable several time you can observer different errors like heap corruption, assertions, and missing platform plugins message (which is most frequent).

       

      I have attached a simple project to reproduce the behavior

       

        Attachments

        1. qt-bug.zip
          2 kB
          Oleksandr Kuznietsov
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              thiago Thiago Macieira
              Reporter:
              teivaz Oleksandr Kuznietsov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes