Solved QWebEngine is crashing without Qt::AA_UseSoftwareOpenGL attribute
-
Hi community.
I faced with the problem, that the simple QWebEngineWidget application is crashing on my custom Qt build (5.14.1). If I'll set QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL); - everything woks fine. Setting Qt::AA_ShareOpenGLContexts or Qt::AA_UseOpenGLES - causes crash
I tested the same example on Qt 5.15.4 binaries from Qt installer - test example was working without Qt::AA_UseSoftwareOpenGL.I am building Qt with params:
set "QTMODULES=-skip qt3d -skip qtandroidextras -skip qtconnectivity -skip qtdatavis3d -skip qtgamepad -skip qtlocation -skip qtlottie -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtremoteobjects -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtwebchannel -skip qtspeech -skip qtvirtualkeyboard -skip qtwayland -skip qtwebglplugin -skip qtwebsockets -skip qtwebview -skip qtx11extras" call ../configure -debug-and-release -force-debug-info -no-build-qtpdf -no-webengine-webrtc -no-webengine-spellchecker -no-webengine-printing-and-pdf -no-webengine-pepper-plugins -commercial -confirm-license -shared -optimized-tools -mp -ltcg -no-icu -opengl es2 -angle -combined-angle-lib -openssl-linked -I "%OpenSSL_Output%\include" -L "%OpenSSL_Output%\lib" OPENSSL_LIBS="-llibssl -llibcrypto -lUser32 -lGdi32 -lWs2_32 -lAdvapi32 -lCrypt32" -make tools -nomake examples %QTSIMD% %QTMODULES% %QTMKSPEC% -make-tool "%localdir%jom.exe" -prefix "%~1"
- With which parameters does usually Qt build from installer?
- How can I build QWebEngineCore.dll to work without Qt::AA_UseSoftwareOpenGL attribute?
Additionally I tried to build Qt5.14.1 with the latest QWebEngine 5.15.6 - but the problem still present
Application example (taken from webenginewidget qt examples)
#include <QApplication> #include <QWebEngineView> QUrl commandLineUrlArgument() { const QStringList args = QCoreApplication::arguments(); for (const QString &arg : args.mid(1)) { if (!arg.startsWith(QLatin1Char('-'))) return QUrl::fromUserInput(arg); } return QUrl(QStringLiteral("https://www.qt.io")); } int main(int argc, char *argv[]) { QCoreApplication::setOrganizationName("QtExamples"); QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication app(argc, argv); QWebEngineView view; view.setUrl(commandLineUrlArgument()); view.resize(1024, 750); view.show(); return app.exec(); }
-
Issue solved by removing -combined-angle-lib param from configure.
If we'll build Qt with -opengl es2 -angle -combined-angle-lib options, it will create QtAngle.dll and no libEGL.dll and libGLESv2.dll will be created (which is OK due -combined-angle-lib) but in this case QtWebengineCore.dll will crash.
Removing -combined-angle-lib will not create QtAngle.dll and application will use libEGL.dll and libGLESv2.dll instead which doesn't cause crash for the QtWebengineCore.dll
I just wonder is it expected behavior?