Solved My app in Qt 5.7, Windows 7, 64 bit-compile crashed in d3d11sdklayers.dll
-
I create an app on Windows 7, compiled as 32 bit, and it runs fine. However when I switch everything to 64 bit, the app could not run. It crash in d3d11sdklayers.dll. Here is the stack trace:
d3d11sdklayers.dll!000007fedcbc4469() Unknown d3d11sdklayers.dll!000007fedcba2971() Unknown libGLESv2d.dll!rx::Renderer11::populateRenderer11DeviceCaps() Line 893 C++ libGLESv2d.dll!rx::Renderer11::initializeDevice() Line 806 C++ libGLESv2d.dll!rx::Renderer11::initialize() Line 689 C++ libGLESv2d.dll!rx::CreateRendererD3D(egl::Display * display, rx::RendererD3D * * outRenderer) Line 124 C++ libGLESv2d.dll!rx::DisplayD3D::initialize(egl::Display * display) Line 249 C++ libGLESv2d.dll!egl::Display::initialize() Line 369 C++ libGLESv2d.dll!egl::Initialize(void * dpy, int * major, int * minor) Line 59 C++ libEGLd.dll!eglInitialize(void * dpy, int * major, int * minor) Line 88 C++ qwindowsd.dll!QWindowsEGLStaticContext::create(QFlags<enum QWindowsOpenGLTester::Renderer> preferredType) Line 246 C++ qwindowsd.dll!QWindowsStaticOpenGLContext::doCreate() Line 419 C++ qwindowsd.dll!QWindowsStaticOpenGLContext::create() Line 436 C++ qwindowsd.dll!QWindowsIntegration::staticOpenGLContext() Line 470 C++ qwindowsd.dll!QWindowsIntegration::createPlatformOpenGLContext(QOpenGLContext * context) Line 441 C++ Qt5Guid.dll!QOpenGLContext::create() Line 612 C++ Qt5WebEngineCored.dll!0000000180173b5b() Unknown Qt5WebEngined.dll!QtWebEngine::initialize() Line 75 C++ EMnetXClient.exe!main(int argc, char * * argv) Line 169 C++ EMnetXClient.exe!WinMain(HINSTANCE__ * __formal, HINSTANCE__ * __formal, char * __formal, int __formal) Line 123 C++
In EMnetXClient it crashes right at
QQmlContext*rootContext = engine.rootContext();Any clue?
[Added code formatting tags ~kshegunov]
-
@TonyN
Hi,
Could you provide a little bit of your code surrounding line 169 inmain()
?Kind regards.
-
QQmlApplicationEngine engine; QtWebEngine::initialize(); QQmlContext*rootContext = engine.rootContext(); // <<< Crash here rootContext->setContextProperty("deviceID", QVariant::fromValue(g_config.queueName())); rootContext->setContextProperty("webSiteURL", QVariant::fromValue(g_config.websiteUrl())); rootContext->setContextObject(p_gCommStatus); engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); initTrayIcon(engine); return app.exec();
The initTrayIcon function:
void initTrayIcon(QQmlApplicationEngine &engine) { QObject *root = 0; if (engine.rootObjects().size() > 0) { root = engine.rootObjects().at(0); QAction *minimizeAction = new QAction(QObject::tr("Mi&nimize"), root); root->connect(minimizeAction, SIGNAL(triggered()), root, SLOT(hide())); QAction *maximizeAction = new QAction(QObject::tr("Ma&ximize"), root); root->connect(maximizeAction, SIGNAL(triggered()), root, SLOT(showMaximized())); QAction *restoreAction = new QAction(QObject::tr("&Restore"), root); root->connect(restoreAction, SIGNAL(triggered()), root, SLOT(showNormal())); QAction *quitAction = new QAction(QObject::tr("&Quit"), root); root->connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); QMenu *trayIconMenu = new QMenu(); trayIconMenu->addAction(minimizeAction); trayIconMenu->addAction(maximizeAction); trayIconMenu->addAction(restoreAction); trayIconMenu->addSeparator(); trayIconMenu->addAction(quitAction); QSystemTrayIcon *trayIcon = new QSystemTrayIcon(root); trayIcon->setContextMenu(trayIconMenu); trayIcon->setIcon(QIcon(":/Images/heart.svg")); trayIcon->show(); } }
-
Hi, if you compile in Release mode does it still crash the same way?
-
@kshegunov I check the the debug log in the 32 bit version, and I think there is something relate to it. The line 168 " QtWebEngine::initialize();" is actually show a warning
D3D11: ERROR: ID3D11Device::CheckFormatSupport: Format (null) is not available at the current FeatureLevel. [ MISCELLANEOUS ERROR #2097402: CHECKFORMATSUPPORT_FORMAT_NOT_SUPPORTED ]This is actually the culprit that crash the app in 64 bit version. I step thru the code in 64bit, and at that location, I got an access violation. The next line (169) will stop the app.
Stack trace is here
1 D3D11TranslateCreateDevice D3D11SDKLayers 0x7fed9d44469
2 D3D11TranslateCreateDevice D3D11SDKLayers 0x7fed9d22971
3 rx::Renderer11::populateRenderer11DeviceCaps renderer11.cpp 893 0x7fed2c17a8d
4 rx::Renderer11::initializeDevice renderer11.cpp 806 0x7fed2c151c3
5 rx::Renderer11::initialize renderer11.cpp 689 0x7fed2c143d5
6 rx::CreateRendererD3D displayd3d.cpp 124 0x7fed29ff51a
7 rx::DisplayD3D::initialize displayd3d.cpp 249 0x7fed2a00ecb
8 egl::Display::initialize display.cpp 369 0x7fed28c9968
9 egl::Initialize entry_points_egl.cpp 59 0x7fed2ac6878
10 eglInitialize libegl.cpp 88 0x7fee2821d1d
11 QWindowsEGLStaticContext::create qwindowseglcontext.cpp 246 0x7fed736c140
12 QWindowsStaticOpenGLContext::doCreate qwindowsintegration.cpp 419 0x7fed72ec135
13 QWindowsStaticOpenGLContext::create qwindowsintegration.cpp 436 0x7fed72ebd79
14 QWindowsIntegration::staticOpenGLContext qwindowsintegration.cpp 470 0x7fed72eb58b
15 QWindowsIntegration::createPlatformOpenGLContext qwindowsintegration.cpp 441 0x7fed72eb44e
16 QOpenGLContext::create qopenglcontext.cpp 612 0x7fed4097830
17 QtWebEngineCore::initialize Qt5WebEngineCored 0x180173b5b
18 QtWebEngine::initialize qtwebengineglobal.cpp 75 0x7feddd40899
19 main main.cpp 169 0x13f1f8479
20 WinMain qtmain_win.cpp 123 0x13f23824d
21 __tmainCRTStartup crtexe.c 618 0x13f2375e1
22 WinMainCRTStartup crtexe.c 466 0x13f23735e
23 BaseThreadInitThunk kernel32 0x76dd652d
24 RtlUserThreadStart ntdll 0x7716c521 -
@hskoglund Interesting... the release version of 64bit does not!
How so!!? -
@TonyN
From what I can tell from your code you aren't doing anything wrong. Obviously there's some problem with initializing direct 3D, but what exactly causes this I don't know, sorry.Kind regards.
-
Hi, TonyN
Have you solved it? I have the same problem. -
@zhong-san No, I submitted a bug report and was accepted, but it still not resolve yet
-
I end up used a different graphic board. The driver for Intel HD 3000 just buggy and they end support on 2015!. I don't know how to get around this with old computer from customers yet