Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.9.0, 5.9.1
-
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
Issue Links
- is duplicated by
-
QTBUG-78766 HEAP_CORRUPTION when disposing of QByteArray object
- Closed
- is replaced by
-
QTBUG-61675 Static Linking
- Closed
- relates to
-
QTBUG-68514 [REG] MSVC2015 static debug builds are broken in Qt 5.11 (CrtIsValidHeapPointer(block))
- Closed
-
QTBUG-73318 [qt widgets] qRegisterWidgetsVariant() order of initialization
- Closed
-
QTBUG-73217 Qt Quick Applications fail to start when Qt is built with -static -static-runtime options
- Closed