Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
None
-
5.15.5
-
None
-
Windows 10 64bit, Intel UHD 630 graphics driver, reproduced with version 27.20.100.8681 and 30.0.100.9684
Description
When opening a Qt window containing the QtWebView, during initialization, there is a potential deadlock. See the callstacks of 2 threads (attached pics):
- Thread 1 is the normal Qt Gui thread
opengl32.dll!wglSetPixelFormat -> ig9icd64.dll - Thread 2 is the WebEngine GPU thread
ig9icd64.dll -> opengl32.dll!wglSetPixelFormat
Both stuck in a critical section, obviously a classic deadlock.
ig9icd64.dll is the graphics driver for Intel UHD 630 graphics chip.
The problem occurs not deterministically, but (at least on one pc) quite often.
Suggested solution: Somehow synchronize the 2 threads, so that SetPixelFormat is not called parallel, but in sequence.
This is the code creating the Qt Dialog with the QtWebView (your web fronted is removing the newlines, sorry):
QWidget* HtmlDialogQt::OpenDialogWindow(QWidget* dlgwnd){ dlgwnd->resize(800, 600); QGridLayout* gridLayout = new QGridLayout(); dlgwnd->setLayout(gridLayout); QWebEngineView* webwidget = new QWebEngineView(); gridLayout->addWidget(webwidget); QString path = Util::UnicodeToUTF8(m_uri.c_str()).c_str(); if (path.startsWith(L"http")) webwidget->setUrl(QUrl(path)); else webwidget->setUrl(QUrl::fromLocalFile(path)); webwidget->setParent(dlgwnd); QPushButton* closeButton = new QPushButton("Close"); closeButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); gridLayout->addWidget(closeButton, 1, 0, Qt::AlignHCenter); QObject::connect(closeButton, &QPushButton::clicked, this, &HtmlDialogQt::slotCloseButtonClicked); dlgwnd->show(); return closeButton; }
Thread 2 is started by setUrl()
Thread 1 is show();