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

Exe with static linked Qt: Crash an start (Debug only, VS 2017<15.7.3): Invalid address specified to RtlValidateHeap

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.9.0, 5.9.1
    • Core: Other
    • None
    • Windows 7 64 Bit

      Visual Studio Community 2017 (Platform 'Visual Studio 2017 v141) Version  15.2 (26430.14)

      Qt Version: qt-everywhere-opensource-src-5.9.1

    Description

      If can not start a program which uses statically linked Qt Libs on Windows 7. The Qt-Libs and the program are build with Visual Studio 2017. Running the progrmm with release build works fine.

      The program is simple:

      #include <QApplication>
      
      const QString globalString = "abcd";
      
      #include <QtCore/QtPlugin>
      {Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
      
      int main(int argc, char *argv[])}
      \{
      {{    QApplication app(argc, argv);}}
      {{    return app.exec();}}
      {{}}}
      

      Running it with debug build will crash with this execption:

      HEAP[QtStaticTest.exe]: Invalid address specified to RtlValidateHeap( 006F0000, 022F6904 ). It is the free(data) from qarraydata.cpp void QArrayData:deallocate()
      

      It seems the first free of memory will led to the crash. I have added QString globalString  to get a simple stack trace. Maybe the the memory was allocated from a different heap or memory area?

      Command Line to create the static Qt libs:

      E:\Entwicklung\qt\qt-everywhere-opensource-src-5.9.1\qt-everywhere-opensource-src-5.9.1\configure -prefix E:\Entwicklung\qt\qt59_vs_2017_static_debug -platform win32-msvc2017 -debug-and-release -static -static-runtime -opensource -nomake tests    -nomake examples    -no-opengl     -skip qt3d    -skip qtactiveqt    -skip qtandroidextras    -skip qtcanvas3d    -skip qtcharts    -skip qtconnectivity    -skip qtdatavis3d    -skip qtdeclarative    -skip qtdoc    -skip qtgamepad    -skip qtgraphicaleffects    -skip qtimageformats    -skip qtlocation    -skip qtmacextras    -skip qtmultimedia    -skip qtnetworkauth    -skip qtpurchasing    -skip qtquickcontrols    -skip qtquickcontrols2    -skip qtremoteobjects    -skip qtscript    -skip qtsensors    -skip qtserialbus    -skip qtserialport    -skip qtspeech    -skip qtsvg    -skip qtvirtualkeyboard    -skip qtwayland    -skip qtwebchannel    -skip qtwebengine    -skip qtwebsockets    -skip qtwebview    -skip qtwinextras     -skip qtx11extras
      

      Note: using only "-debug" will not build at all

      Linked libs (without standard libs)

      {{E:\Entwicklung\qt\qt59_vs2017_dll\lib\Qt5Widgetsd.lib}}
       {{E:\Entwicklung\qt\qt59_vs2017_dll\lib\Qt5XmlPatternsd.lib}}
       {{E:\Entwicklung\qt\qt59_vs2017_dll\plugins\platforms\qwindowsd.lib}}
       {{E:\Entwicklung\qt\qt59_vs2017_dll\plugins\platforms\qdirect2dd.lib}}
       {{E:\Entwicklung\qt\qt59_vs2017_dll\lib\qtharfbuzzd.lib}}
       {{E:\Entwicklung\qt\qt59_vs2017_dll\lib\qtfreetyped.lib}}
       {{E:\Entwicklung\qt\qt59_vs2017_dll\lib\Qt5AccessibilitySupportd.lib}}
       {{E:\Entwicklung\qt\qt59_vs2017_dll\lib\Qt5FontDatabaseSupportd.lib}}
       {{E:\Entwicklung\qt\qt59_vs2017_dll\lib\qtpcre2d.lib}}
       {{E:\Entwicklung\qt\qt59_vs2017_dll\lib\Qt5EventDispatcherSupportd.lib}}
       {{E:\Entwicklung\qt\qt59_vs2017_dll\lib\Qt5ThemeSupportd.lib}}
       {{E:\Entwicklung\qt\qt59_vs2017_dll\lib\qtlibpngd.lib}}
       {{imm32.lib}}
       {{winmm.lib}}
       {{Ws2_32.lib}}
       {{UxTheme.lib}}
       {{Dwmapi.lib}}
       {{version.lib}}
       {{Iphlpapi.lib}}
       {{E:\Entwicklung\qt\qt59_vs2017_dll\lib\Qt5Guid.lib}}
       {{E:\Entwicklung\qt\qt59_vs2017_dll\lib\Qt5Networkd.lib}}
       {{E:\Entwicklung\qt\qt59_vs2017_dll\lib\Qt5Cored.lib}}
       {{E:\Entwicklung\qt\qt59_vs2017_dll\lib\qtmaind.lib}}
      

      Attached file contains the example program, the build scripts and the cmake script.

       

       

      Attachments

        1. QTBUG-61752.zip
          58 kB
          Jochen Baier

        Issue Links

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

          Activity

            People

              thiago Thiago Macieira
              pulp Jochen Baier
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes