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

Race condition initializing qt config

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 5.12.3
    • Core: I/O
    • None
    • Visual Studio 2017
      CMake (>=3.5)
      Qt 5.12.3
    • 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

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

        Activity

          People

            thiago Thiago Macieira
            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