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



    • 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


      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>
      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)


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




        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.



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



                Gerrit Reviews

                  There are no open Gerrit changes