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

QApplication fails to start on release mode when using Qt as a backend of a plugin (Windows)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2: Important
    • None
    • 5.5.0
    • Core: Other
    • None
    • Windows 8 / Qt 5.5.0 Source / Static build with configure line: configure -prefix c:\qt\5.5\msvc2013_opengl_x86_static -commercial -debug-and-release -static -nomake examples -nomake tools -nomake tests -opengl desktop -skip webkit -skip multimedia

    Description

      I'm using Qt as a backend of a VST plugin to be used on audio hosts. I have built Qt 5.5.0 from source statically. What am I doing?

      I have declared this two static variables:

      static int argc=1;
      static char **argv = new char*[argc];
      

      On the plugin main I have the following code to initialize Qt:

      if (!app)
      {
          #ifdef Q_OS_WIN
          LPWSTR *argvv = CommandLineToArgvW(GetCommandLineW(), &argc);
          argv[0] = qstrdup(QString::fromStdWString(argvv[0]).toLocal8Bit().constData());
          #endif
      
          app = new QApplication(argc, argv);
      }
      

      Before ensuring that the same arguments were being provided to QApplication argc and argv, when building and running in debug mode I had an ASSERTION alert: Q_ASSERT(allArguments.size() == origArgc);

      Then I have fixed the code to the version above and the assertion warning disappeared. Thats when I changed to release mode and tried again, but now, it crashes as soon as QApplication is initialized.

      The only output I have is:

      argc: 1 argv[0]: C:\ProgramData\Ableton\Live 9 
      Standard\Program\Ableton Live 9 Standard.exe
      
      First-chance exception at 0x148AC104 (drc.dll) in Ableton Live 9 
      Standard.exe: 0xC0000005: Access violation reading location 0x00000000.
      

      Attachments

        Issue Links

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

          Activity

            People

              kleint Friedemann Kleint
              sinosoidal Nuno Santos
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes