Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-48276

Frequent deadlocks with Qml WebEngineView

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.6.0 RC
    • 5.5.0
    • None
    • Windows 7 x64 SP1
      MSVC 2013 Update 4 (amd64)
      Qt 5.5.0 x64 msvc2013 (reproduced both with official packages and from a custom-built version).
      NVIDIA OpenGL driver (from NVIDIA driver version 337.88)
    • eca92de29c5a9048f4b15c5f9aa96b7ad8235b49

    Description

      We have a Qml2 application that needs to load/unload WebEngineViews quite frequently as the current user selection changes (through Loader items that load components that include WebEngineViews). We are often encountering complete deadlocks where the application stops rendering and becomes forever unresponsive as the user changes its selection.

      The stack traces show the following 3 interesting threads below, where:

      • The main thread seems to be waiting after the scenegraph render thread for the WebEngineView.
      • The scene graph render thread seems to be waiting for the WebEngine's textures to be uploaded on the WebEngine GPU thread
      • The WebEngine GPU thread seems to wait for the main thread to be able to create its GPU context.
      Main thread
       	ntdll.dll!ZwWaitForSingleObject()	Unknown
       	KernelBase.dll!WaitForSingleObjectEx()	Unknown
       	Qt5Cored.dll!QWaitConditionPrivate::wait(QWaitConditionEvent * wce, unsigned long time) Line 113	C++
       	Qt5Cored.dll!QWaitCondition::wait(QMutex * mutex, unsigned long time) Line 178	C++
      >	Qt5Quickd.dll!QSGThreadedRenderLoop::polishAndSync(QSGThreadedRenderLoop::Window * w, bool inExpose) Line 1148	C++
       	Qt5Quickd.dll!QSGThreadedRenderLoop::handleUpdateRequest(QQuickWindow * window) Line 975	C++
       	Qt5Quickd.dll!QQuickWindow::event(QEvent * e) Line 1402	C++
       	Qt5Widgetsd.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3720	C++
       	Qt5Widgetsd.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3161	C++
       	Qt5Cored.dll!QCoreApplication::notifyInternal(QObject * receiver, QEvent * event) Line 965	C++
       	Qt5Cored.dll!QCoreApplication::sendEvent(QObject * receiver, QEvent * event) Line 224	C++
       	Qt5Guid.dll!QWindowPrivate::deliverUpdateRequest() Line 2082	C++
       	Qt5Guid.dll!QWindow::event(QEvent * ev) Line 2064	C++
       	Qt5Quickd.dll!QQuickWindow::event(QEvent * e) Line 1415	C++
       	Qt5Widgetsd.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3720	C++
       	Qt5Widgetsd.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3161	C++
       	Qt5Cored.dll!QCoreApplication::notifyInternal(QObject * receiver, QEvent * event) Line 965	C++
       	Qt5Cored.dll!QCoreApplication::sendEvent(QObject * receiver, QEvent * event) Line 224	C++
       	Qt5Cored.dll!QEventDispatcherWin32Private::sendTimerEvent(int timerId) Line 618	C++
       	Qt5Cored.dll!QEventDispatcherWin32::event(QEvent * e) Line 1196	C++
       	Qt5Widgetsd.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3720	C++
       	Qt5Widgetsd.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3161	C++
       	Qt5Cored.dll!QCoreApplication::notifyInternal(QObject * receiver, QEvent * event) Line 965	C++
       	Qt5Cored.dll!QCoreApplication::sendEvent(QObject * receiver, QEvent * event) Line 224	C++
       	Qt5Cored.dll!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver, int event_type, QThreadData * data) Line 1593	C++
       	Qt5Cored.dll!QCoreApplication::sendPostedEvents(QObject * receiver, int event_type) Line 1452	C++
       	qwindowsd.dll!QWindowsGuiEventDispatcher::sendPostedEvents() Line 82	C++
       	Qt5Cored.dll!qt_internal_proc(HWND__ * hwnd, unsigned int message, unsigned __int64 wp, __int64 lp) Line 414	C++
       	user32.dll!UserCallWinProcCheckWow()	Unknown
       	user32.dll!DispatchMessageWorker()	Unknown
       	Qt5Cored.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 807	C++
       	qwindowsd.dll!QWindowsGuiEventDispatcher::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 73	C++
       	Qt5Cored.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 129	C++
       	Qt5Cored.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 204	C++
       	Qt5Cored.dll!QCoreApplication::exec() Line 1229	C++
       	Qt5Guid.dll!QGuiApplication::exec() Line 1529	C++
       	Qt5Widgetsd.dll!QApplication::exec() Line 2978	C++
       	OmniShell.exe!main(int argc, char * * argv) Line 301	C++
       	OmniShell.exe!WinMain(HINSTANCE__ * __formal, HINSTANCE__ * __formal, char * __formal, int __formal) Line 113	C++
       	OmniShell.exe!__tmainCRTStartup() Line 618	C
       	OmniShell.exe!WinMainCRTStartup() Line 466	C
       	kernel32.dll!BaseThreadInitThunk()	Unknown
       	ntdll.dll!RtlUserThreadStart()	Unknown
      
      QSGRenderThread
       	ntdll.dll!ZwWaitForSingleObject()	Unknown
       	KernelBase.dll!WaitForSingleObjectEx()	Unknown
       	Qt5Cored.dll!QWaitConditionPrivate::wait(QWaitConditionEvent * wce, unsigned long time) Line 113	C++
       	Qt5Cored.dll!QWaitCondition::wait(QMutex * mutex, unsigned long time) Line 178	C++
      >	Qt5WebEngineCored.dll!QtWebEngineCore::DelegatedFrameNode::preprocess() Line 420	C++
       	Qt5Quickd.dll!QSGRenderer::preprocess() Line 270	C++
       	Qt5Quickd.dll!QSGRenderer::renderScene(const QSGBindable & bindable) Line 190	C++
       	Qt5Quickd.dll!QSGRenderer::renderScene(unsigned int fboId) Line 169	C++
       	Qt5Quickd.dll!QSGRenderContext::renderNextFrame(QSGRenderer * renderer, unsigned int fboId) Line 560	C++
       	Qt5Quickd.dll!QQuickWindowPrivate::renderSceneGraph(const QSize & size) Line 385	C++
       	Qt5Quickd.dll!QSGRenderThread::syncAndRender() Line 594	C++
       	Qt5Quickd.dll!QSGRenderThread::run() Line 677	C++
       	Qt5Cored.dll!QThreadPrivate::start(void * arg) Line 346	C++
       	msvcr120d.dll!_callthreadstartex() Line 376	C
       	msvcr120d.dll!_threadstartex(void * ptd) Line 359	C
       	kernel32.dll!BaseThreadInitThunk()	Unknown
       	ntdll.dll!RtlUserThreadStart()	Unknown
      
      Chrome_InProcGpuThread
       	ntdll.dll!ZwWaitForSingleObject()	Unknown
       	KernelBase.dll!WaitForSingleObjectEx()	Unknown
       	Qt5Cored.dll!QWaitConditionPrivate::wait(QWaitConditionEvent * wce, unsigned long time) Line 113	C++
       	Qt5Cored.dll!QWaitCondition::wait(QMutex * mutex, unsigned long time) Line 178	C++
       	Qt5Cored.dll!QSemaphore::acquire(int n) Line 137	C++
       	Qt5Cored.dll!QMetaMethod::invoke(QObject * object, Qt::ConnectionType connectionType, QGenericReturnArgument returnValue, QGenericArgument val0, QGenericArgument val1, QGenericArgument val2, QGenericArgument val3, QGenericArgument val4, QGenericArgument val5, QGenericArgument val6, QGenericArgument val7, QGenericArgument val8, QGenericArgument val9) Line 2241	C++
       	Qt5Cored.dll!QMetaObject::invokeMethod(QObject * obj, const char * member, Qt::ConnectionType type, QGenericReturnArgument ret, QGenericArgument val0, QGenericArgument val1, QGenericArgument val2, QGenericArgument val3, QGenericArgument val4, QGenericArgument val5, QGenericArgument val6, QGenericArgument val7, QGenericArgument val8, QGenericArgument val9) Line 1479	C++
      >	Qt5WebEngineCored.dll!GLContextHelper::initializeContext(gfx::GLContext * context, gfx::GLSurface * surface) Line 98	C++
       	Qt5WebEngineCored.dll!gfx::GLContext::CreateGLContext(gfx::GLShareGroup * share_group, gfx::GLSurface * compatible_surface, gfx::GpuPreference gpu_preference) Line 153	C++
       	Qt5WebEngineCored.dll!content::GpuCommandBufferStub::OnInitialize(void * shared_state_handle, IPC::Message * reply_message) Line 545	C++
       	Qt5WebEngineCored.dll!DispatchToMethod<content::GpuCommandBufferStub,void (__cdecl content::GpuCommandBufferStub::*)(void * __ptr64,IPC::Message * __ptr64) __ptr64,void * __ptr64,IPC::Message & __ptr64>(content::GpuCommandBufferStub * obj, void (void *, IPC::Message *) * method, const Tuple1<void *> & in, Tuple1<IPC::Message &> * out) Line 804	C++
       	Qt5WebEngineCored.dll!IPC::SyncMessageSchema<Tuple1<void * __ptr64>,Tuple2<bool & __ptr64,gpu::Capabilities & __ptr64> >::DispatchDelayReplyWithSendParams<content::GpuCommandBufferStub,void (__cdecl content::GpuCommandBufferStub::*)(void * __ptr64,IPC::Message * __ptr64) __ptr64>(bool ok, const Tuple1<void *> & send_params, const IPC::Message * msg, content::GpuCommandBufferStub * obj, void (void *, IPC::Message *) * func) Line 917	C++
       	Qt5WebEngineCored.dll!GpuCommandBufferMsg_Initialize::DispatchDelayReply<content::GpuCommandBufferStub,void,void (__cdecl content::GpuCommandBufferStub::*)(void * __ptr64,IPC::Message * __ptr64) __ptr64>(const IPC::Message * msg, content::GpuCommandBufferStub * obj, void * parameter, void (void *, IPC::Message *) * func) Line 468	C++
       	Qt5WebEngineCored.dll!content::GpuCommandBufferStub::OnMessageReceived(const IPC::Message & message) Line 258	C++
       	Qt5WebEngineCored.dll!content::MessageRouter::RouteMessage(const IPC::Message & msg) Line 55	C++
       	Qt5WebEngineCored.dll!content::GpuChannel::HandleMessage() Line 693	C++
       	Qt5WebEngineCored.dll!base::internal::RunnableAdapter<void (__cdecl content::GpuChannel::*)(void) __ptr64>::Run(content::GpuChannel * object) Line 135	C++
       	Qt5WebEngineCored.dll!base::internal::InvokeHelper<1,void,base::internal::RunnableAdapter<void (__cdecl content::GpuChannel::*)(void) __ptr64>,void __cdecl(base::WeakPtr<content::GpuChannel> const & __ptr64)>::MakeItSo(base::internal::RunnableAdapter<void (__cdecl content::GpuChannel::*)(void)> runnable, const base::WeakPtr<content::GpuChannel> & weak_ptr) Line 883	C++
       	Qt5WebEngineCored.dll!base::internal::Invoker<1,base::internal::BindState<base::internal::RunnableAdapter<void (__cdecl content::GpuChannel::*)(void) __ptr64>,void __cdecl(content::GpuChannel * __ptr64),void __cdecl(base::WeakPtr<content::GpuChannel>)>,void __cdecl(content::GpuChannel * __ptr64)>::Run(base::internal::BindStateBase * base) Line 1170	C++
       	Qt5WebEngineCored.dll!base::Callback<void __cdecl(void)>::Run() Line 402	C++
       	Qt5WebEngineCored.dll!base::debug::TaskAnnotator::RunTask(const char * queue_function, const char * run_function, const base::PendingTask & pending_task) Line 65	C++
       	Qt5WebEngineCored.dll!base::MessageLoop::RunTask(const base::PendingTask & pending_task) Line 449	C++
       	Qt5WebEngineCored.dll!base::MessageLoop::DeferOrRunPendingTask(const base::PendingTask & pending_task) Line 459	C++
       	Qt5WebEngineCored.dll!base::MessageLoop::DoWork() Line 565	C++
       	Qt5WebEngineCored.dll!QtWebEngineCore::`anonymous namespace'::MessagePumpForUIQt::handleScheduledWork() Line 175	C++
       	Qt5WebEngineCored.dll!QtWebEngineCore::`anonymous namespace'::MessagePumpForUIQt::customEvent(QEvent * ev) Line 157	C++
       	Qt5Cored.dll!QObject::event(QEvent * e) Line 1273	C++
       	Qt5Widgetsd.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3720	C++
       	Qt5Widgetsd.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3161	C++
       	Qt5Cored.dll!QCoreApplication::notifyInternal(QObject * receiver, QEvent * event) Line 965	C++
       	Qt5Cored.dll!QCoreApplication::sendEvent(QObject * receiver, QEvent * event) Line 224	C++
       	Qt5Cored.dll!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver, int event_type, QThreadData * data) Line 1593	C++
       	Qt5Cored.dll!QEventDispatcherWin32::sendPostedEvents() Line 1203	C++
       	Qt5Cored.dll!qt_internal_proc(HWND__ * hwnd, unsigned int message, unsigned __int64 wp, __int64 lp) Line 414	C++
       	user32.dll!UserCallWinProcCheckWow()	Unknown
       	user32.dll!DispatchMessageWorker()	Unknown
       	Qt5Cored.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 807	C++
       	Qt5Cored.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 129	C++
       	Qt5Cored.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 204	C++
       	Qt5WebEngineCored.dll!QtWebEngineCore::`anonymous namespace'::MessagePumpForUIQt::Run(base::MessagePump::Delegate * delegate) Line 127	C++
       	Qt5WebEngineCored.dll!base::MessageLoop::RunHandler() Line 416	C++
       	Qt5WebEngineCored.dll!base::RunLoop::Run() Line 56	C++
       	Qt5WebEngineCored.dll!base::MessageLoop::Run() Line 309	C++
       	Qt5WebEngineCored.dll!base::Thread::Run(base::MessageLoop * message_loop) Line 175	C++
       	Qt5WebEngineCored.dll!base::Thread::ThreadMain() Line 229	C++
       	Qt5WebEngineCored.dll!base::`anonymous namespace'::ThreadFunc(void * params) Line 80	C++
       	kernel32.dll!BaseThreadInitThunk()	Unknown
       	ntdll.dll!RtlUserThreadStart()	Unknown
      

      I will attempt to assemble a minimal example that reproduces the issue and update this issue.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              jbornema Joerg Bornemann
              acossette Alexandre Cossette-Pacheco
              Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes