Skip to content

Commit fda0da4

Browse files
committed
QWaylandWindow: fix data race on mFrameCallbackTimedOut
WARNING: ThreadSanitizer: data race Write of size 1 at 0x7b5000008aa0 by thread T51 (mutexes: write M1, write M2): #0 QtWaylandClient::QWaylandWindow::waitForFrameSync(int) qtwayland/src/client/qwaylandwindow.cpp:784 (libQt6WaylandClient.so.6+0xdd6a9) #1 QtWaylandClient::QWaylandGLContext::swapBuffers(QPlatformSurface*) qtwayland/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp:393 (libQt6WaylandEglClientHwIntegration.so.6+0xc706) #2 QOpenGLContext::swapBuffers(QSurface*) qtbase/src/gui/kernel/qopenglcontext.cpp:783 (libQt6Gui.so.6+0x80c6df) #3 QRhiGles2::endFrame(QRhiSwapChain*, QFlags<QRhi::EndFrameFlag>) qtbase/src/gui/rhi/qrhigles2.cpp:1984 (libQt6Gui.so.6+0x85bbda) #4 QRhi::endFrame(QRhiSwapChain*, QFlags<QRhi::EndFrameFlag>) qtbase/src/gui/rhi/qrhi.cpp:7689 (libQt6Gui.so.6+0x58faf0) #5 QSGRenderThread::syncAndRender() qtdeclarative/src/quick/scenegraph/qsgthreadedrenderloop.cpp:748 (libQt6Quick.so.6+0x7bb88a) Previous write of size 1 at 0x7b5000008aa0 by main thread: #0 QtWaylandClient::QWaylandWindow::timerEvent(QTimerEvent*) qtwayland/src/client/qwaylandwindow.cpp:1480 (libQt6WaylandClient.so.6+0xdc079) Pick-to: 6.9 6.8 6.5 Change-Id: Ieb8819c5a273e6581975b258d4728bb6f3325da6 Reviewed-by: Konstantin Ritt <[email protected]>
1 parent caec57a commit fda0da4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/client/qwaylandwindow_p.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ public Q_SLOTS:
301301
GestureState mGestureState = GestureNotActive;
302302
#endif
303303

304-
bool mFrameCallbackTimedOut = false; // Whether the frame callback has timed out
304+
std::atomic_bool mFrameCallbackTimedOut = false; // Whether the frame callback has timed out
305305
int mFrameCallbackCheckIntervalTimerId = -1;
306306
QAtomicInt mWaitingForUpdateDelivery = false;
307307

0 commit comments

Comments
 (0)