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

invalid plugin metaData in debug mode with msvc2017

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Out of scope
    • Affects Version/s: 5.12.0
    • Fix Version/s: None
    • Component/s: Core: Plugins
    • Labels:
      None
    • Environment:
      windows10 + visual studio 2015 + Qt5.12.0 Debug Mode
    • Platform/s:
      Windows

      Description

      I got an error msg when trying the plugins module --"Unexpected metadata contents". And I followed into the source codes and found the jsonFromCborMetaData() function. It shows that there is no valid meta data in the .dll file. So I searched the *.dll file for "*QTMEATADATA!" and got the following contents.

       

      51 54 4d 45 54 41 44 41 54 41 20 21 20 05 0c 00
      00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
      00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 

       

      It seems that Qt plugin module finds "QTMEATADATA!" but can't parse the following contents.

      More, I manully modified the moc_XXX.cpp file, by replacing qPluginArchRequirements() with 1, and compiled again, the error disappeared.

      QT_PLUGIN_METADATA_SECTION
      static constexpr unsigned char qt_pluginMetaData[] = {
          'Q', 'T', 'M', 'E', 'T', 'A', 'D', 'A', 'T', 'A', ' ', '!',
          // metadata version, Qt version, architectural requirements
          0, QT_VERSION_MAJOR, QT_VERSION_MINOR, 1/*qPluginArchRequirements()*/,
          0xbf, 
          // "IID"
          0x02,  0x68,  'H',  'e',  'l',  'l',  'o',  'C', 
          'T',  'K', 
          // "className"
          0x03,  0x6e,  'H',  'e',  'l',  'l',  'o',  'A', 
          'c',  't',  'i',  'v',  'a',  't',  'o',  'r', 
          0xff, 
      };
      QT_MOC_EXPORT_PLUGIN(HelloActivator, HelloActivator)
      

      I searched the *.dll file again and here is the resust 

      51 54 4d 45 54 41 44 41 54 41 20 21 20 05 0c 01
      bf 02 68 48 65 6c 6c 6f 43 54 4b 03 6e 48 65 6c
      6c 6f 41 63 74 69 76 61 74 6f 72 ff 00 00 00 00 

      The release mode is OK.

      It seems that qt_pluginMetaData is not stored as a static array under debug mode due to the function call. Which will cause the fatal parsing when using *.dll.

       

       

       

       

        Attachments

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

          Activity

            People

            Assignee:
            thiago Thiago Macieira
            Reporter:
            anima liu lili
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes