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

Deadlock on WebEngineView destruction

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • None
    • 6.2.4
    • WebEngine
    • None
    • Windows 10, OpenGL RHI
    • Windows

    Description

      Got sporadic deadlock in Qt rendering code. Seems it happens on WebEngineView destruction.
      Unfortunately, at the moment this has only happened once in my application and I don't have clear steps/preconditions/examples for this.

      Main thread:

      >	[Inline Frame] Qt6Core.dll!QWaitConditionPrivate::wait(QWaitConditionEvent *) Line 111	C++
       	Qt6Core.dll!QWaitCondition::wait(QMutex * mutex, unsigned long time) Line 169	C++
       	Qt6Core.dll!QWaitCondition::wait(QMutex * mutex, QDeadlineTimer deadline) Line 180	C++
       	Qt6Quick.dll!QSGThreadedRenderLoop::polishAndSync(QSGThreadedRenderLoop::Window * w, bool inExpose) Line 1550	C++
       	Qt6Quick.dll!QSGThreadedRenderLoop::handleUpdateRequest(QQuickWindow * window) Line 1363	C++
       	Qt6Quick.dll!QQuickWindow::event(QEvent * e) Line 1543	C++
       	Qt6Widgets.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3411	C++
       	Qt6Widgets.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3363	C++
       	Qt6Core.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Line 1067	C++
       	Qt6Gui.dll!QPlatformWindow::deliverUpdateRequest() Line 811	C++
       	Qt6Gui.dll!QPlatformWindow::windowEvent(QEvent * event) Line 491	C++
       	Qt6Widgets.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 2667	C++
       	Qt6Core.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Line 1067	C++
       	Qt6Core.dll!QEventDispatcherWin32Private::sendTimerEvent(int timerId) Line 409	C++
       	Qt6Core.dll!QEventDispatcherWin32::event(QEvent * e) Line 891	C++
       	Qt6Widgets.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3411	C++
       	Qt6Widgets.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3363	C++
       	Qt6Core.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Line 1067	C++
       	[Inline Frame] Qt6Core.dll!QCoreApplication::sendEvent(QObject *) Line 1475	C++
       	Qt6Core.dll!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver, int event_type, QThreadData * data) Line 1834	C++
       	Qt6Gui.dll!QWindowsGuiEventDispatcher::sendPostedEvents() Line 80	C++
       	Qt6Core.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 476	C++
       	Qt6Gui.dll!QWindowsGuiEventDispatcher::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 73	C++
       	[Inline Frame] Qt6Core.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag>) Line 139	C++
       	Qt6Core.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 230	C++
       	Qt6Core.dll!QCoreApplication::exec() Line 1382	C++
      

      Chrome_InProcGpuThread (388):

       	[Waiting on lock owned by Thread 9096, double-click or press enter to switch to thread]	
       	[External Code]	
      >	Qt6WebEngineCore.dll!gl::PbufferGLSurfaceWGL::Destroy() Line 424	C++
       	Qt6WebEngineCore.dll!gl::PbufferGLSurfaceWGL::~PbufferGLSurfaceWGL() Line 384	C++
       	[External Code]	
       	[Inline Frame] Qt6WebEngineCore.dll!base::RefCounted<gl::GLSurface,base::DefaultRefCountedTraits<gl::GLSurface>>::DeleteInternal(const gl::GLSurface *) Line 350	C++
       	[Inline Frame] Qt6WebEngineCore.dll!base::DefaultRefCountedTraits<gl::GLSurface>::Destruct(const gl::GLSurface *) Line 316	C++
       	[Inline Frame] Qt6WebEngineCore.dll!base::RefCounted<gl::GLSurface,base::DefaultRefCountedTraits<gl::GLSurface>>::Release() Line 339	C++
       	[Inline Frame] Qt6WebEngineCore.dll!scoped_refptr<gl::PbufferGLSurfaceWGL>::Release(gl::PbufferGLSurfaceWGL * ptr) Line 322	C++
       	[Inline Frame] Qt6WebEngineCore.dll!scoped_refptr<gl::PbufferGLSurfaceWGL>::{dtor}() Line 224	C++
       	[Inline Frame] Qt6WebEngineCore.dll!scoped_refptr<gl::PbufferGLSurfaceWGL>::reset() Line 254	C++
       	[Inline Frame] Qt6WebEngineCore.dll!scoped_refptr<gl::PbufferGLSurfaceWGL>::operator=(void *) Line 240	C++
       	Qt6WebEngineCore.dll!gl::GLSurfaceWGLQt::Destroy() Line 73	C++
       	Qt6WebEngineCore.dll!gl::GLSurfaceWGLQt::~GLSurfaceWGLQt() Line 56	C++
       	[External Code]	
       	[Inline Frame] Qt6WebEngineCore.dll!base::internal::OptionalStorageBase<viz::SkiaOutputSurfaceImplOnGpu::ReleaseCurrent,0>::{dtor}() Line 58	C++
       	[Inline Frame] Qt6WebEngineCore.dll!base::internal::OptionalBase<viz::SkiaOutputSurfaceImplOnGpu::ReleaseCurrent>::{dtor}() Line 255	C++
       	[Inline Frame] Qt6WebEngineCore.dll!base::Optional<viz::SkiaOutputSurfaceImplOnGpu::ReleaseCurrent>::{dtor}() Line 559	C++
       	Qt6WebEngineCore.dll!viz::SkiaOutputSurfaceImplOnGpu::~SkiaOutputSurfaceImplOnGpu() Line 598	C++
       	[External Code]	
       	[Inline Frame] Qt6WebEngineCore.dll!base::OnceCallback<void __cdecl(void)>::Run() Line 101	C++
       	[Inline Frame] Qt6WebEngineCore.dll!viz::SkiaOutputSurfaceImpl::FlushGpuTasks::__l2::<lambda_6071d863eba8908894695076fa80c0dd>::operator()(std::vector<base::OnceCallback<void __cdecl(void)>,std::allocator<base::OnceCallback<void __cdecl(void)>>> event, base::WaitableEvent * impl_on_gpu, viz::SkiaOutputSurfaceImplOnGpu * need_framebuffer, bool) Line 1003	C++
       	[Inline Frame] Qt6WebEngineCore.dll!base::internal::FunctorTraits<<lambda_6071d863eba8908894695076fa80c0dd>,void>::Invoke(viz::SkiaOutputSurfaceImpl::FlushGpuTasks::__l2::<lambda_6071d863eba8908894695076fa80c0dd> &&) Line 379	C++
       	[Inline Frame] Qt6WebEngineCore.dll!base::internal::InvokeHelper<0,void>::MakeItSo(viz::SkiaOutputSurfaceImpl::FlushGpuTasks::__l2::<lambda_6071d863eba8908894695076fa80c0dd> &&) Line 637	C++
       	[Inline Frame] Qt6WebEngineCore.dll!base::internal::Invoker<base::internal::BindState<<lambda_6071d863eba8908894695076fa80c0dd>,std::vector<base::OnceCallback<void __cdecl(void)>,std::allocator<base::OnceCallback<void __cdecl(void)>>>,base::WaitableEvent *,viz::SkiaOutputSurfaceImplOnGpu *,bool>,void __cdecl(void)>::RunImpl(viz::SkiaOutputSurfaceImpl::FlushGpuTasks::__l2::<lambda_6071d863eba8908894695076fa80c0dd> &&) Line 710	C++
       	Qt6WebEngineCore.dll!base::internal::Invoker<base::internal::BindState<<lambda_6071d863eba8908894695076fa80c0dd>,std::vector<base::OnceCallback<void __cdecl(void)>,std::allocator<base::OnceCallback<void __cdecl(void)>>>,base::WaitableEvent *,viz::SkiaOutputSurfaceImplOnGpu *,bool>,void __cdecl(void)>::RunOnce(base::internal::BindStateBase * base) Line 679	C++
       	[Inline Frame] Qt6WebEngineCore.dll!base::OnceCallback<void __cdecl(void)>::Run() Line 101	C++
       	Qt6WebEngineCore.dll!gpu::Scheduler::RunNextTask() Line 577	C++
       	[Inline Frame] Qt6WebEngineCore.dll!base::internal::FunctorTraits<void (__cdecl printing::PrintJobWorker::*)(void),void>::Invoke(void(printing::PrintJobWorker::*)()) Line 498	C++
       	[Inline Frame] Qt6WebEngineCore.dll!base::internal::InvokeHelper<1,void>::MakeItSo(void(printing::PrintJobWorker::*)() &&) Line 657	C++
       	[Inline Frame] Qt6WebEngineCore.dll!base::internal::Invoker<base::internal::BindState<void (__cdecl printing::PrintJobWorker::*)(void),base::WeakPtr<printing::PrintJobWorker>>,void __cdecl(void)>::RunImpl(void(printing::PrintJobWorker::*)() &&) Line 710	C++
       	Qt6WebEngineCore.dll!base::internal::Invoker<base::internal::BindState<void (__cdecl printing::PrintJobWorker::*)(void),base::WeakPtr<printing::PrintJobWorker>>,void __cdecl(void)>::RunOnce(base::internal::BindStateBase * base) Line 683	C++
       	[Inline Frame] Qt6WebEngineCore.dll!base::OnceCallback<void __cdecl(void)>::Run() Line 101	C++
       	Qt6WebEngineCore.dll!base::TaskAnnotator::RunTask(const char * trace_event_name, base::PendingTask * pending_task) Line 163	C++
       	Qt6WebEngineCore.dll!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::sequence_manager::LazyNow * continuation_lazy_now) Line 352	C++
       	Qt6WebEngineCore.dll!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() Line 266	C++
       	Qt6WebEngineCore.dll!base::MessagePumpDefault::Run(base::MessagePump::Delegate * delegate) Line 40	C++
       	Qt6WebEngineCore.dll!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool application_tasks_allowed, base::TimeDelta timeout) Line 463	C++
       	Qt6WebEngineCore.dll!base::RunLoop::Run(const base::Location & location) Line 135	C++
       	Qt6WebEngineCore.dll!base::Thread::Run(base::RunLoop * run_loop) Line 312	C++
       	Qt6WebEngineCore.dll!base::Thread::ThreadMain() Line 385	C++
       	Qt6WebEngineCore.dll!base::`anonymous namespace'::ThreadFunc(void * params) Line 114	C++
       	[External Code]	
      

      Some RHI thread (9096):

       	[Waiting on lock owned by Thread 388, double-click or press enter to switch to thread]	
       	[External Code]	
      >	[Inline Frame] Qt6Gui.dll!QOpenGLFunctions::glDrawElements(unsigned int) Line 756	C++
       	Qt6Gui.dll!QRhiGles2::executeCommandBuffer(QRhiCommandBuffer * cb) Line 2853	C++
       	Qt6Gui.dll!QRhiGles2::endFrame(QRhiSwapChain * swapChain, QFlags<enum QRhi::EndFrameFlag> flags) Line 1825	C++
       	Qt6Gui.dll!QRhi::endFrame(QRhiSwapChain * swapChain, QFlags<enum QRhi::EndFrameFlag> flags) Line 6699	C++
       	Qt6Quick.dll!QSGRenderThread::syncAndRender() Line 788	C++
       	Qt6Quick.dll!QSGRenderThread::run() Line 984	C++
       	Qt6Core.dll!QThreadPrivate::start(void * arg) Line 328	C++
       	[External Code]	
      

      VizCompositorThread:

       	[External Code]	
      >	Qt6WebEngineCore.dll!base::WaitableEvent::Wait() Line 74	C++
       	Qt6WebEngineCore.dll!viz::SkiaOutputSurfaceImpl::FlushGpuTasks(bool wait_for_finish) Line 1020	C++
       	Qt6WebEngineCore.dll!viz::SkiaOutputSurfaceImpl::~SkiaOutputSurfaceImpl() Line 145	C++
       	[External Code]	
       	[Inline Frame] Qt6WebEngineCore.dll!std::default_delete<viz::OutputSurface>::operator()(viz::OutputSurface *) Line 3120	C++
       	[Inline Frame] Qt6WebEngineCore.dll!std::unique_ptr<viz::OutputSurface,std::default_delete<viz::OutputSurface>>::{dtor}() Line 3230	C++
       	Qt6WebEngineCore.dll!viz::Display::~Display() Line 369	C++
       	[External Code]	
       	[Inline Frame] Qt6WebEngineCore.dll!std::default_delete<viz::RootCompositorFrameSinkImpl>::operator()(viz::RootCompositorFrameSinkImpl *) Line 3120	C++
       	[Inline Frame] Qt6WebEngineCore.dll!std::unique_ptr<viz::RootCompositorFrameSinkImpl,std::default_delete<viz::RootCompositorFrameSinkImpl>>::{dtor}() Line 3230	C++
       	[Inline Frame] Qt6WebEngineCore.dll!std::_Default_allocator_traits<std::allocator<std::pair<viz::FrameSinkId,std::unique_ptr<viz::RootCompositorFrameSinkImpl,std::default_delete<viz::RootCompositorFrameSinkImpl>>>>>::destroy(std::allocator<std::pair<viz::FrameSinkId,std::unique_ptr<viz::RootCompositorFrameSinkImpl,std::default_delete<viz::RootCompositorFrameSinkImpl>>>> &) Line 723	C++
       	[Inline Frame] Qt6WebEngineCore.dll!std::_Destroy_range(std::pair<viz::FrameSinkId,std::unique_ptr<viz::RootCompositorFrameSinkImpl,std::default_delete<viz::RootCompositorFrameSinkImpl>>> * _First, std::pair<viz::FrameSinkId,std::unique_ptr<viz::RootCompositorFrameSinkImpl,std::default_delete<viz::RootCompositorFrameSinkImpl>>> * const) Line 950	C++
       	[Inline Frame] Qt6WebEngineCore.dll!std::vector<std::pair<viz::FrameSinkId,std::unique_ptr<viz::RootCompositorFrameSinkImpl,std::default_delete<viz::RootCompositorFrameSinkImpl>>>,std::allocator<std::pair<viz::FrameSinkId,std::unique_ptr<viz::RootCompositorFrameSinkImpl,std::default_delete<viz::RootCompositorFrameSinkImpl>>>>>::_Destroy(std::pair<viz::FrameSinkId,std::unique_ptr<viz::RootCompositorFrameSinkImpl,std::default_delete<viz::RootCompositorFrameSinkImpl>>> *) Line 1680	C++
       	[Inline Frame] Qt6WebEngineCore.dll!std::vector<std::pair<viz::FrameSinkId,std::unique_ptr<viz::RootCompositorFrameSinkImpl,std::default_delete<viz::RootCompositorFrameSinkImpl>>>,std::allocator<std::pair<viz::FrameSinkId,std::unique_ptr<viz::RootCompositorFrameSinkImpl,std::default_delete<viz::RootCompositorFrameSinkImpl>>>>>::erase(std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<std::pair<viz::FrameSinkId,std::unique_ptr<viz::RootCompositorFrameSinkImpl,std::default_delete<viz::RootCompositorFrameSinkImpl>>>>>>) Line 1442	C++
       	[Inline Frame] Qt6WebEngineCore.dll!base::internal::flat_tree<viz::FrameSinkId,base::internal::GetFirst,std::less<void>,std::vector<std::pair<viz::FrameSinkId,std::unique_ptr<viz::RootCompositorFrameSinkImpl,std::default_delete<viz::RootCompositorFrameSinkImpl>>>,std::allocator<std::pair<viz::FrameSinkId,std::unique_ptr<viz::RootCompositorFrameSinkImpl,std::default_delete<viz::RootCompositorFrameSinkImpl>>>>>>::erase(std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<std::pair<viz::FrameSinkId,std::unique_ptr<viz::RootCompositorFrameSinkImpl,std::default_delete<viz::RootCompositorFrameSinkImpl>>>>>>) Line 905	C++
       	Qt6WebEngineCore.dll!base::internal::flat_tree<viz::FrameSinkId,base::internal::GetFirst,std::less<void>,std::vector<std::pair<viz::FrameSinkId,std::unique_ptr<viz::RootCompositorFrameSinkImpl,std::default_delete<viz::RootCompositorFrameSinkImpl>>>,std::allocator<std::pair<viz::FrameSinkId,std::unique_ptr<viz::RootCompositorFrameSinkImpl,std::default_delete<viz::RootCompositorFrameSinkImpl>>>>>>::erase<viz::FrameSinkId>(const viz::FrameSinkId & val) Line 897	C++
       	Qt6WebEngineCore.dll!viz::FrameSinkManagerImpl::InvalidateFrameSinkId(const viz::FrameSinkId & frame_sink_id) Line 153	C++
       	Qt6WebEngineCore.dll!viz::mojom::FrameSinkManagerStubDispatch::Accept(viz::mojom::FrameSinkManager * impl, mojo::Message * message) Line 1640	C++
       	Qt6WebEngineCore.dll!mojo::InterfaceEndpointClient::HandleValidatedMessage(mojo::Message * message) Line 557	C++
       	Qt6WebEngineCore.dll!mojo::MessageDispatcher::Accept(mojo::Message * message) Line 43	C++
       	Qt6WebEngineCore.dll!mojo::internal::MultiplexRouter::ProcessIncomingMessage(mojo::internal::MultiplexRouter::MessageWrapper * message_wrapper, mojo::internal::MultiplexRouter::ClientCallBehavior client_call_behavior, base::SequencedTaskRunner * current_task_runner) Line 954	C++
       	Qt6WebEngineCore.dll!mojo::internal::MultiplexRouter::Accept(mojo::Message * message) Line 622	C++
       	Qt6WebEngineCore.dll!mojo::MessageDispatcher::Accept(mojo::Message * message) Line 43	C++
       	Qt6WebEngineCore.dll!mojo::Connector::DispatchMessageW(mojo::Message message) Line 507	C++
       	Qt6WebEngineCore.dll!mojo::Connector::ReadAllAvailableMessages() Line 566	C++
       	[Inline Frame] Qt6WebEngineCore.dll!base::internal::FunctorTraits<void (__cdecl printing::PrintJobWorker::*)(void),void>::Invoke(void(printing::PrintJobWorker::*)()) Line 498	C++
       	[Inline Frame] Qt6WebEngineCore.dll!base::internal::InvokeHelper<1,void>::MakeItSo(void(printing::PrintJobWorker::*)() &&) Line 657	C++
       	[Inline Frame] Qt6WebEngineCore.dll!base::internal::Invoker<base::internal::BindState<void (__cdecl printing::PrintJobWorker::*)(void),base::WeakPtr<printing::PrintJobWorker>>,void __cdecl(void)>::RunImpl(void(printing::PrintJobWorker::*)() &&) Line 710	C++
       	Qt6WebEngineCore.dll!base::internal::Invoker<base::internal::BindState<void (__cdecl printing::PrintJobWorker::*)(void),base::WeakPtr<printing::PrintJobWorker>>,void __cdecl(void)>::RunOnce(base::internal::BindStateBase * base) Line 683	C++
       	[Inline Frame] Qt6WebEngineCore.dll!base::OnceCallback<void __cdecl(void)>::Run() Line 101	C++
       	Qt6WebEngineCore.dll!base::TaskAnnotator::RunTask(const char * trace_event_name, base::PendingTask * pending_task) Line 163	C++
       	Qt6WebEngineCore.dll!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::sequence_manager::LazyNow * continuation_lazy_now) Line 352	C++
       	Qt6WebEngineCore.dll!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() Line 266	C++
       	Qt6WebEngineCore.dll!base::MessagePumpDefault::Run(base::MessagePump::Delegate * delegate) Line 40	C++
       	Qt6WebEngineCore.dll!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool application_tasks_allowed, base::TimeDelta timeout) Line 463	C++
       	Qt6WebEngineCore.dll!base::RunLoop::Run(const base::Location & location) Line 135	C++
       	Qt6WebEngineCore.dll!base::Thread::Run(base::RunLoop * run_loop) Line 312	C++
       	Qt6WebEngineCore.dll!base::Thread::ThreadMain() Line 385	C++
       	Qt6WebEngineCore.dll!base::`anonymous namespace'::ThreadFunc(void * params) Line 114	C++
       	[External Code]	
      

      Pay attention that Chrome_InProcGpuThread (9096) and RHI thread (388) lock each other.

      Attachments

        Issue Links

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

          Activity

            People

              qt_webengine_team Qt WebEngine Team
              studiosus Vladimir Belyavsky
              Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes