APPCRASH in Windows with every Qt application
I have a problem deploying a custom application using latest Qt (version 5.5.0).
I compiled all libraries from sources using Mingw with OpenSSL, ICU and zlib.
I successfully compiled my application and I used windeployqt.exe to copy all the libraries into a "deploy" folder.
But when I try to start my application, it crashes saying APPCRASH in Qt5Core.dll. Using gdb from a Command Line Prompt I noticed that my App do a SEGFAULT with this backtrace:
Program received signal SIGSEGV, Segmentation fault. 0x68c101b7 in ZN7QObject7connectEPKS_PKcS1_S3_N2Qt14ConnectionTypeE () from C:\Users\sardylan\Documents\qtbalrx-deploy\Qt5Core.dll (gdb) bt full #0 0x68c101b7 in ZN7QObject7connectEPKS_PKcS1_S3_N2Qt14ConnectionTypeE () from C:\Users\sardylan\Documents\qtbalrx-deploy\Qt5Core.dll No symbol table info available. #1 0x00f435a9 in ZN7WebCore19initializeWebCoreQtEv () from C:\Users\sardylan\Documents\qtbalrx-deploy\Qt5WebKit.dll No symbol table info available. #2 0x0028fa8c in ?? () No symbol table info available. #3 0xec815356 in ?? () No symbol table info available. #4 0x0000015c in ?? () No symbol table info available. #5 0x8b0c5d8b in ?? () No symbol table info available. #6 0x7d8b1075 in ?? () No symbol table info available. #7 0x74db8514 in ?? () from C:\WINDOWS\SYSTEM32\setupapi.dll No symbol table info available. Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Same think happens trying to launch a fresh compiled qtCreator.
I'm using these software versions:
- Windows Pro 8.1 x64 (updated)
- Qt 5.5.0
- MinGW-w64: i686-5.1.0-posix-dwarf-rt_v4-rev0
- OpenSSL: 1.0.2c
- Zlib: 1.2.8
- ICU: 55.1
Searching in Internet I've found similar problems which make me thinking is a Windows Problem or something related to leaking of base system libraries.
Any idea to solve this problem?
Do you have a working Qt Creator installed and did you build the application in Qt Creator? If you did, does it run when you launch from inside Creator?
thanks for your answer.
I've not a working Qt Creator. I tried to build it from sources, but things are like my application. Compilation completed without problems but the application crashes.
Maybe there is a problem with GCC 5? I'm trying to repeat all procedures using a previous version of GCC.
Edit: same application built in Linux with Qt 5.5.0 (built from sources) works without problems.
What are you using for a build environment for your application (Windows command prompt, MSYS shell, etc)? Can you build and run a simple example, such as application.exe in <Qt Sources>/qtbase/examples/widgets/mainwindows/application ?
I'm using Windows Command Prompt opened double-clicking on mingw-w64.bat file.
Before launching every command, I execute a simple .bat file to include all necessary directories:
set NEWPATH=C:\mysystem\winflex set NEWPATH=%NEWPATH%;C:\mysystem\gperf-3.0.1\bin set NEWPATH=%NEWPATH%;C:\qt-5.5.0\bin set NEWPATH=%NEWPATH%;C:\qt-5.5.0\lib set NEWPATH=%NEWPATH%;C:\mysystem\zlib-1.2.8\bin set NEWPATH=%NEWPATH%;C:\mysystem\zlib-1.2.8\lib set NEWPATH=%NEWPATH%;C:\mysystem\openssl-1.0.2c\bin set NEWPATH=%NEWPATH%;C:\mysystem\openssl-1.0.2c\lib set NEWPATH=%NEWPATH%;C:\mysystem\icu-55.1\bin set NEWPATH=%NEWPATH%;C:\mysystem\icu-55.1\lib set PATH=%NEWPATH%;%PATH% set NEWPATH=
Then I created an empty folder, start "qmake <path to src>" into it and "mingw32-make" to start the building process.
After that I copy the new created executable file from "release" directory into another empty folder and run "windeployqt.exe" to copy all necessary files and folders.
Just adding OpenSSL libraries by hand and start the application.
I also have MSYS installed (used for OpenSSL and ICU4c building), but nothing is included in PATH. I also tried to copy the deploy folder with all libraries inside into another computer and the application crashes the same way.
Qt was built using this command line:
configure ^ -prefix C:\qt-5.5.0 ^ -release ^ -opensource ^ -c++11 ^ -shared ^ -nomake examples ^ -opengl dynamic ^ -qt-sql-sqlite ^ -system-zlib ^ -qt-pcre ^ -icu ^ -qt-libpng ^ -qt-libjpeg ^ -openssl ^ OPENSSL_LIBS="-lssleay32 -leay32" ^ -I C:\mysystem\zlib-1.2.8\include ^ -L C:\mysystem\zlib-1.2.8\bin ^ -L C:\mysystem\zlib-1.2.8\lib ^ -I C:\mysystem\openssl-1.0.2c\include ^ -L C:\mysystem\openssl-1.0.2c\bin ^ -L C:\mysystem\openssl-1.0.2c\lib ^ -I C:\mysystem\icu-55.1\include ^ -L C:\mysystem\icu-55.1\bin ^ -L C:\mysystem\icu-55.1\lib
I also installed Windows SDK for ANGLE and QtActive.
I just tried to compile the example application, as you suggested.
Everything is working fine and I can run it from the build environment.
Copying executable in another folder and running windeployqt.exe works without problems. I can start the test application simply double-clicking in the executable.
It's at least a starting point to understand why other program don't run.
Edit: trying different test applications I had the APPCRASH error only in QtWebKit-examples, with the same error in gdb. Since my Application uses QtWebKit, I guess that the problems is in that library. I will try cleaning and rebuilding it.
You said you built Qt Creator with the same crash. Do you know if it uses QtWebKit, as well?
I don't know if QtCreator uses WebKit, but I guess yes, because it uses almost everything of Qt libraries just because it import all features to populate the "widget list" in the UI designer.
My poor old i3 has just finish to rebuild QtWebKit and now I'm doing "mingw32-make install".
Just few minutes and I retry to build example applications, QtCreator and my Application.
Still the same problem:
#0 0x68c101b7 in ZN7QObject7connectEPKS_PKcS1_S3_N2Qt14ConnectionTypeE () from C:\qt-5.5.0\bin\Qt5Core.dll No symbol table info available. #1 0x65ea35a9 in ZN7WebCore19initializeWebCoreQtEv () from C:\qt-5.5.0\bin\Qt5WebKit.dll No symbol table info available. #2 0x0028d4ac in ?? () No symbol table info available. #3 0xec815356 in ?? () No symbol table info available. #4 0x0000015c in ?? () No symbol table info available. #5 0x8b0c5d8b in ?? () No symbol table info available. #6 0x7d8b1075 in ?? () No symbol table info available. #7 0x74db8514 in ?? () from C:\WINDOWS\SYSTEM32\user32.dll No symbol table info available. Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Same error with my application and with qtwebkit-examples\examples\webkitwidgets\browser\release\browser.exe
Now I'm re-building qtcreator, but I guess I will have the same problem.
Well, I built the latest source from git (branch 5.5) last night using i686-4.9.2-release-win32-sjlj-rt_v4-rev3 toolchain and the browser example works. There are a few differences in how I configured Qt, as well as using a different toochain than you. For one, I skipped the QtActiveQt module because that won't build for me. I see you posted a patch in another thread, but I haven't looked into that yet. I also don't have the WIndows SDK for ANGLE installed. Here is how I configured:
-opensource -opengl desktop
I know this is not a solution, but I thought it might help knowing a configuration of 5.5 that works on another system.
One more example you might want to try if you haven't already is todos.exe in <qt_source>/qtenginio/examples/enginio/quick/todos . You need to add -enginio option to windeployqt. The reason I suggest this is just to confirm that there isn't a problem with the zlib, openssl and icu dlls you built. I know that this application uses all three.
I had somehow similar Problem. Running a Debug Versino from within Qt Creator worked fine. As soon as I switched to Release, the App Crashed with Error Code 255. Running it manually from without Qt Creator gave me an "Entry Point _zn7qobject7connectepks_pkcs1_s3_n2qt14connectiontypee not found" in my executable.
As it turned out, the only Compiler that could build a healthy Qt Framework, is the one from this precompiled Package
qt-opensource-windows-x86-mingw492-5.5.0.exe - Link to the Download Site - not to the executable :)
If you have self compiled dependencies like i.e. OpenSSL or ICU, you must recompile them first.
Newer Compiler Versions working partially but Qt 5.5 introduced a lot of incompatibilities and broke a lot of Stuff. There are no fixes to make them compatible with Qt 5.5.
And just in case: No I have not found an working x86_64 Compiler yet.
Many thanks for suggestions.
I read somewhere that Qt 5.5.0 has deprecated WebKit because they choose to replace it with WebEngine, which is the Engine behind Chromium Project. Even Google Chrome will switch from WebKit to this new rendering engine called Blink, which is started as a fork of WebKit.
WebKit integration is going to be broken, and no one seems to develop it anymore.
I successfully (after 6-8 hours) built Qt 5.5.0 with WebEngine and without WebKit on Linux 64bit.
I also compiled last QtCreator without problems, but new IDE doesn't have WebEngine Widget listed in UI Designer mode. I modify ui file by hand and everything seems working fine.
Next days I will test gcc 4.9.2 (gcc 5 seems not officially supported on Qt 5.5) with WebEngine on Windows 8.1 32bit.
Just to stay On Topic, my initial AppCrash Segfault problem in my app and other Qt programs seems related to QtWebKit. I hope to resolv it with new WebEngine on windows too...
I don't think you can use WebEngine with MinGW. You may need VS2013. See this wiki QtWebEngine On Windows .
Paul H. is right:
You can NOT build the WebEngine with MinGW. It has some Hardcoded MSVC Dependencies in the Chromium Engine. Thats one of the reasons, I will still use WebKit. Another one is, that a lot of Features that WebKit has, are still missing in WebEngine.
And I hate MSVC. A lot of personal bad experience with compiling, installing, distributing etc. But thats another Story.
Anyway, good Luck with the WebEngine. If your WebKit App has not some very special Features, WebEngine will most probably work you. But dont quote me on that, I have never used WebEngine yet because I am a MinGW Guy.
BTW: QtCreator is just an IDE. Compiled with MSVC on Windows. I forgot about Mac and Linux.
So at least on Windows You dont need to compile it yourself. QtCreator use the Qt Framework that you have compiled and prepared by setting up a Kit. In 99 Precent of the cases, building it yourself is only wasted time :)
If you decide to stick with MinGW and WebKit, see this post for tool chains that work with Qt 5.5.0
I didn't know that WebEngine in Windows is strongly related with MSVC. Linux build has built without problem, so I supposed the same for Windows build.
So I will retry using MinGW and WebKit with a fresh build in a fresh environment.
I guess that Qt6 will not be ready for long time...
@Paul-H. thanks for your link. I already answer in that thread for GUID problems.
@MeerMusik You're right... Thanks for your suggestion. I always develop in Linux and use Windows only for building using Command Prompt. I never think to use a precompiled QtCreator on Windows...
After different tests and building processes I'm able to build and run an application with WebKit on Windows 10 with MinGW.
I simply replaced original shipped WebKit with a fresh one from git repository.
Working software versions are:
- MinGW-w64 5.2.0 i686 posix dwarf
- OpenSSL 1.0.2d
- zlib 1.2.8
- ICU4c 55.1
- Qt 5.5.0 (with fresh qtwebkit module from git)
I'm using Windows 10 64bit with both Windows SDK installed and DirectX SDK (installed with DXSDK_Jun10.exe), but I think that it's possible to disable angle and force OpenGL to desktop in order to avoid installing MSVC and DirectX.
I'm trying to compile the same environment on 64bit. I'll update this thread on finish.