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

Heap corruption at startup of static Debug builds

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 5.11.0 Beta 4
    • Core: Plugins
    • None

    Description

      In static builds there's a memory corruption before main() even starts.

      See attached example project.

      Crash dump here: https://www.dropbox.com/s/ewpmquiw4b8znxs/TestQt511.exe.1692.dmp.7z?dl=0

      The stack is part of the auto-generated static plugin loader CPP. The exception occurs in the very first plugin.

      // This file is autogenerated by qmake. It imports static plugin classes for
      // static plugins specified using QTPLUGIN and QT_PLUGIN_CLASS.<plugin> variables.
      #include <QtPlugin>
      Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) // <-- exception here
      

       

      Stack trace:

           ntdll.dll!RtlpValidateHeapEntry()    Unknown
           ntdll.dll!_RtlValidateHeap@12()    Unknown
           KernelBase.dll!_HeapValidate@12()    Unknown
           TestQt511.exe!_CrtIsValidHeapPointer(const void * block) Line 1407    C++
           TestQt511.exe!free_dbg_nolock(void * const block, const int block_use) Line 904    C++
           TestQt511.exe!_free_dbg(void * block, int block_use) Line 1030    C++
           TestQt511.exe!free(void * block) Line 28    C++
      >    TestQt511.exe!QArrayData::deallocate(QArrayData * data, unsigned int objectSize, unsigned int alignment) Line 167    C++
           TestQt511.exe!QTypedArrayData<QStaticPlugin>::deallocate(QArrayData * data) Line 237    C++
           TestQt511.exe!QVector<QStaticPlugin>::reallocData(const int asize, const int aalloc, QFlags<enum QArrayData::AllocationOption> options) Line 640    C++
           TestQt511.exe!QVector<QStaticPlugin>::append(const QStaticPlugin & t) Line 683    C++
           TestQt511.exe!qRegisterStaticPluginFunction(QStaticPlugin plugin) Line 435    C++
           TestQt511.exe!StaticQWindowsIntegrationPluginPluginInstance::StaticQWindowsIntegrationPluginPluginInstance() Line 4    C++
           TestQt511.exe!`dynamic initializer for 'staticQWindowsIntegrationPluginInstance''() Line 4    C++
           TestQt511.exe!_initterm(void(*)() * first, void(*)() * last) Line 22    C++
           TestQt511.exe!__scrt_common_main_seh() Line 251    C++
           TestQt511.exe!__scrt_common_main() Line 326    C++
           TestQt511.exe!WinMainCRTStartup() Line 17    C++
           kernel32.dll!@BaseThreadInitThunk@12()    Unknown
           ntdll.dll!__RtlUserThreadStart()    Unknown
           ntdll.dll!__RtlUserThreadStart@8()    Unknown
      
      

      The release build work fine. I don't know if that's because there is really no problem with the release build or because the corruption goes undetected.

      Attachments

        1. config.opt
          0.9 kB
        2. config.summary
          6 kB
        3. TestProject.zip
          1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            hernan.c.martinez Hernan da Cunha Martinez
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes