Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.5
-
None
-
-
02263f21f (dev), b0f96ca63 (6.7), 7df7c28e4 (6.6), 5d7835bdc (tqtc/lts-6.5)
Description
Possible regression, as this deadlock happens frequently with Qt 6.5, and we haven't seen it with Qt 6.2.3.
We have discovered a deadlock on teardown for our application when running Qt 6.5. We haven't found the root cause yet but investigation so far points to a race between the render thread and main thread:
Render thread: QWaylandWindow::beginFrame() locks mSurfaceLock for read
Render thread: QWaylandWindow::handleUpdate() recursively locks and then unlocks mSurfaceLock
Main thread: QWaylandWindow::reset() grabs mSurfaceLock (stuck)
We can help with debugging if the maintainers can give us pointers to which debug output is interesting .
Main thread BT:
#0 0x0000007f6e9c97a8 in __futex_abstimed_wait_cancelable64 () from /lib/libc.so.6 #1 0x0000007f6e9cc420 in pthread_cond_wait@@GLIBC_2.17 () from /lib/libc.so.6 #2 0x0000007f6ec8c990 in std::condition_variable::wait(std::unique_lock<std::mutex>&) () from /lib/libstdc++.so.6 #3 0x0000007f7f6471b4 in QReadWriteLockPrivate::lockForWrite(std::unique_lock<std::mutex>&, int) () from /lib/libQt6Core.so.6 #4 0x0000007f7f6473c8 in QReadWriteLockPrivate::recursiveLockForWrite(int) () from /lib/libQt6Core.so.6 #5 0x0000007f77bc72a0 in QWriteLocker::relock() () from /lib/libQt6WaylandClient.so.6 #6 0x0000007f77b921d4 in QtWaylandClient::QWaylandWindow::reset() () from /lib/libQt6WaylandClient.so.6 #7 0x0000007f7ed25744 in QWindowPrivate::setVisible(bool) () from /lib/libQt6Gui.so.6 #8 0x0000007f7ed22b70 in QWindowPrivate::destroy() () from /lib/libQt6Gui.so.6 #9 0x0000007f7ed25f14 in QWindow::event(QEvent*) () from /lib/libQt6Gui.so.6 #10 0x0000007f7f4b4290 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/libQt6Core.so.6 #11 0x0000007f7eccdc94 in QGuiApplicationPrivate::processCloseEvent(QWindowSystemInterfacePrivate::CloseEvent*) () from /lib/libQt6Gui.so.6 #12 0x0000007f7ed34d48 in bool QWindowSystemInterface::handleCloseEvent<QWindowSystemInterface::SynchronousDelivery>(QWindow*) () from /lib/libQt6Gui.so.6 #13 0x0000007f7ed1fd70 in QWindow::close() () from /lib/libQt6Gui.so.6 #14 0x0000007f7eccd13c in QGuiApplication::event(QEvent*) () from /lib/libQt6Gui.so.6 #15 0x0000007f7f4b4290 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/libQt6Core.so.6 #16 0x0000007f7ecc9b08 in QGuiApplicationPrivate::processApplicationTermination(QWindowSystemInterfacePrivate::WindowSystemEvent*) () from /lib/libQt6Gui.so.6 #17 0x0000007f7ed34edc in bool QWindowSystemInterface::handleApplicationTermination<QWindowSystemInterface::SynchronousDelivery>() () from /lib/libQt6Gui.so.6 #18 0x0000007f7f502b40 in QObject::event(QEvent*) () from /lib/libQt6Core.so.6 #19 0x0000007f7f4b4290 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/libQt6Core.so.6 #20 0x0000007f7f4b7890 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib/libQt6Core.so.6 #21 0x0000007f7f6418ac in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/libQt6Core.so.6 #22 0x0000007f7f0ab6a4 in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/libQt6Gui.so.6 #23 0x0000007f7f4bfe8c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/libQt6Core.so.6 #24 0x0000007f7f4bbfe8 in QCoreApplication::exec() () from /lib/libQt6Core.so.6 #25 0x0000007f7f989348 in UIMain::exec() () from /run/mnt/gui/lib/libphoenix-app.so #26 0x0000007f7f984208 in main () from /run/mnt/gui/lib/libphoenix-app.so
Render thread BT:
#0 0x0000007f6ea2b078 in poll () from /lib/libc.so.6 #1 0x0000007f6c2374c4 in wl_display_dispatch_queue () from /lib/libwayland-client.so.0 #2 0x0000007f6b465f34 in wlEglWaitFrameSync () from /lib/libnvidia-egl-wayland.so.1 #3 0x0000007f6b466d64 in wlEglSwapBuffersWithDamageHook () from /lib/libnvidia-egl-wayland.so.1 #4 0x0000007f6b67e2ec in ?? () from /lib/libEGL_nvidia.so.0 #5 0x0000007f6b6288a0 in ?? () from /lib/libEGL_nvidia.so.0 #6 0x0000007f6b1faf10 in QtWaylandClient::QWaylandGLContext::swapBuffers(QPlatformSurface*) () from /lib/libQt6WaylandEglClientHwIntegration.so.6 #7 0x0000007f7efe9b94 in QRhiGles2::endFrame(QRhiSwapChain*, QFlags<QRhi::EndFrameFlag>) () from /lib/libQt6Gui.so.6 #8 0x0000007f7ee9cf2c in QRhi::endFrame(QRhiSwapChain*, QFlags<QRhi::EndFrameFlag>) () from /lib/libQt6Gui.so.6 #9 0x0000007f7e158ec0 in QSGRenderThread::syncAndRender() () from /lib/libQt6Quick.so.6 #10 0x0000007f7e15a0b8 in QSGRenderThread::run() () from /lib/libQt6Quick.so.6 #11 0x0000007f7f64652c in QThreadPrivate::start(void*) () from /lib/libQt6Core.so.6 #12 0x0000007f6e9cd0e4 in start_thread () from /lib/libc.so.6 #13 0x0000007f6ea3505c in thread_start () from /lib/libc.so.6
Attachments
For Gerrit Dashboard: QTBUG-118890 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
516786,5 | Don't lock render thread when blocking swap is used | dev | qt/qtwayland | Status: MERGED | +2 | 0 |
525030,2 | Don't lock render thread when blocking swap is used | 6.7 | qt/qtwayland | Status: MERGED | +2 | 0 |
525229,2 | Don't lock render thread when blocking swap is used | 6.6 | qt/qtwayland | Status: MERGED | +2 | 0 |
525306,2 | Don't lock render thread when blocking swap is used | tqtc/lts-6.5 | qt/tqtc-qtwayland | Status: MERGED | +2 | 0 |