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

Thread sanitizer (TSAN) warns about data race with QSG Scenegraph (qsgmaterial)

    XMLWordPrintable

Details

    • deadb187b (dev), 2f9820d18 (6.9)

    Description

      I am getting the following warning upon initial rendering of a QQuickWindow in QWayland context:

       

      WARNING: ThreadSanitizer: data race (pid=904433)
        Read of size 1 at 0x7fc92d95d5a0 by thread T55:
          #0 qsg_test_and_clear_material_failure() /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/scenegraph/coreapi/qsgmaterial.cpp:13 (libQt6Quick.so.6+0x448c33)
          #1 QSGBatchRenderer::Renderer::prepareRenderMergedBatch(QSGBatchRenderer::Batch*, QSGBatchRenderer::Renderer::PreparedRenderBatch*) /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp:3177 (libQt6Quick.so.6+0x42255f)
          #2 QSGBatchRenderer::Renderer::prepareRenderPass(QSGBatchRenderer::Renderer::RenderPassContext*) /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp:3782 (libQt6Quick.so.6+0x4269ea)
          #3 QSGBatchRenderer::Renderer::render() /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp:3573 (libQt6Quick.so.6+0x42719a)
          #4 QSGRenderer::renderScene() /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/scenegraph/coreapi/qsgrenderer.cpp:147 (libQt6Quick.so.6+0x45e377)
          #5 QSGDefaultRenderContext::renderNextFrame(QSGRenderer*) /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/scenegraph/qsgdefaultrendercontext.cpp:174 (libQt6Quick.so.6+0x4aebfc)
          #6 QQuickWindowPrivate::renderSceneGraph() /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/items/qquickwindow.cpp:664 (libQt6Quick.so.6+0x3a4e36)
          #7 QSGRenderThread::syncAndRender() /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/scenegraph/qsgthreadedrenderloop.cpp:734 (libQt6Quick.so.6+0x7bf03d)
          #8 QSGRenderThread::run() /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/scenegraph/qsgthreadedrenderloop.cpp:938 (libQt6Quick.so.6+0x7c073a)
          #9 operator() /opt/qt-src/qt6.5-lts/qtbase/src/corelib/thread/qthread_unix.cpp:321 (libQt6Core.so.6+0x4a89f0)
          #10 terminate_on_exception<QThreadPrivate::start(void*)::<lambda()> > /opt/qt-src/qt6.5-lts/qtbase/src/corelib/thread/qthread_unix.cpp:257 (libQt6Core.so.6+0x4a8a84)
          #11 QThreadPrivate::start(void*) /opt/qt-src/qt6.5-lts/qtbase/src/corelib/thread/qthread_unix.cpp:280 (libQt6Core.so.6+0x4a92ea)
        Previous write of size 1 at 0x7fc92d95d5a0 by thread T50:
          #0 qsg_test_and_clear_material_failure() /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/scenegraph/coreapi/qsgmaterial.cpp:14 (libQt6Quick.so.6+0x448c42)
          #1 QSGBatchRenderer::Renderer::prepareRenderMergedBatch(QSGBatchRenderer::Batch*, QSGBatchRenderer::Renderer::PreparedRenderBatch*) /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp:3177 (libQt6Quick.so.6+0x42255f)
          #2 QSGBatchRenderer::Renderer::prepareRenderPass(QSGBatchRenderer::Renderer::RenderPassContext*) /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp:3812 (libQt6Quick.so.6+0x426d98)
          #3 QSGBatchRenderer::Renderer::render() /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp:3573 (libQt6Quick.so.6+0x42719a)
          #4 QSGRenderer::renderScene() /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/scenegraph/coreapi/qsgrenderer.cpp:147 (libQt6Quick.so.6+0x45e377)
          #5 QSGDefaultRenderContext::renderNextFrame(QSGRenderer*) /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/scenegraph/qsgdefaultrendercontext.cpp:174 (libQt6Quick.so.6+0x4aebfc)
          #6 QQuickWindowPrivate::renderSceneGraph() /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/items/qquickwindow.cpp:664 (libQt6Quick.so.6+0x3a4e36)
          #7 QSGRenderThread::syncAndRender() /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/scenegraph/qsgthreadedrenderloop.cpp:734 (libQt6Quick.so.6+0x7bf03d)
          #8 QSGRenderThread::run() /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/scenegraph/qsgthreadedrenderloop.cpp:938 (libQt6Quick.so.6+0x7c073a)
          #9 operator() /opt/qt-src/qt6.5-lts/qtbase/src/corelib/thread/qthread_unix.cpp:321 (libQt6Core.so.6+0x4a89f0)
          #10 terminate_on_exception<QThreadPrivate::start(void*)::<lambda()> > /opt/qt-src/qt6.5-lts/qtbase/src/corelib/thread/qthread_unix.cpp:257 (libQt6Core.so.6+0x4a8a84)
          #11 QThreadPrivate::start(void*) /opt/qt-src/qt6.5-lts/qtbase/src/corelib/thread/qthread_unix.cpp:280 (libQt6Core.so.6+0x4a92ea)
        Location is global 'qsg_material_failure' of size 1 at 0x7fc92d95d5a0 (libQt6Quick.so.6+0x000000b5d5a0)
        Thread T55 'QSGRenderThread' (tid=904533, running) created by main thread at:
          #0 pthread_create ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:969 (libtsan.so.0+0x605b8)
          #1 QThread::start(QThread::Priority) /opt/qt-src/qt6.5-lts/qtbase/src/corelib/thread/qthread_unix.cpp:725 (libQt6Core.so.6+0x4a7660)
          #2 QSGThreadedRenderLoop::handleExposure(QQuickWindow*) /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/scenegraph/qsgthreadedrenderloop.cpp:1292 (libQt6Quick.so.6+0x7c59de)
          #3 QSGThreadedRenderLoop::exposureChanged(QQuickWindow*) /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/scenegraph/qsgthreadedrenderloop.cpp:1211 (libQt6Quick.so.6+0x7c70f4)
          #4 QQuickWindow::exposeEvent(QExposeEvent*) /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/items/qquickwindow.cpp:178 (libQt6Quick.so.6+0x39d050)
          #5 QWindow::event(QEvent*) /opt/qt-src/qt6.5-lts/qtbase/src/gui/kernel/qwindow.cpp:2516 (libQt6Gui.so.6+0x2f67ef)
          #6 QQuickWindow::event(QEvent*) /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/items/qquickwindow.cpp:1627 (libQt6Quick.so.6+0x3af742)
          #7 QCoreApplicationPrivate::notify_helper(QObject*, QEvent*) /opt/qt-src/qt6.5-lts/qtbase/src/corelib/kernel/qcoreapplication.cpp:1294 (libQt6Core.so.6+0x1a58aa)
          #8 doNotify /opt/qt-src/qt6.5-lts/qtbase/src/corelib/kernel/qcoreapplication.cpp:1223 (libQt6Core.so.6+0x1a8c97)
          #9 QCoreApplication::notify(QObject*, QEvent*) /opt/qt-src/qt6.5-lts/qtbase/src/corelib/kernel/qcoreapplication.cpp:1206 (libQt6Core.so.6+0x1a8d38)
          #10 QGuiApplication::notify(QObject*, QEvent*) /opt/qt-src/qt6.5-lts/qtbase/src/gui/kernel/qguiapplication.cpp:1994 (libQt6Gui.so.6+0x22d97f)
          #11 QCoreApplication::notifyInternal2(QObject*, QEvent*) /opt/qt-src/qt6.5-lts/qtbase/src/corelib/kernel/qcoreapplication.cpp:1127 (libQt6Core.so.6+0x1a8eb8)
          #12 QCoreApplication::sendSpontaneousEvent(QObject*, QEvent*) /opt/qt-src/qt6.5-lts/qtbase/src/corelib/kernel/qcoreapplication.cpp:1559 (libQt6Core.so.6+0x1a9087)
          #13 QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent*) /opt/qt-src/qt6.5-lts/qtbase/src/gui/kernel/qguiapplication.cpp:3338 (libQt6Gui.so.6+0x23641a)
          #14 QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) /opt/qt-src/qt6.5-lts/qtbase/src/gui/kernel/qguiapplication.cpp:2191 (libQt6Gui.so.6+0x237966)
          #15 QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) /opt/qt-src/qt6.5-lts/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:1094 (libQt6Gui.so.6+0x2fdc9c)
          #16 userEventSourceDispatch /opt/qt-src/qt6.5-lts/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:38 (libQt6Gui.so.6+0xb223bb)
          #17 g_main_context_dispatch <null> (libglib-2.0.so.0+0x55d3a)
          #18 QPAEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) /opt/qt-src/qt6.5-lts/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:87 (libQt6Gui.so.6+0xb226a2)
          #19 QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) /opt/qt-src/qt6.5-lts/qtbase/src/corelib/kernel/qeventloop.cpp:100 (libQt6Core.so.6+0x1bffa5)
          #20 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) /opt/qt-src/qt6.5-lts/qtbase/src/corelib/kernel/qeventloop.cpp:182 (libQt6Core.so.6+0x1c0e98)
          #21 QCoreApplication::exec() /opt/qt-src/qt6.5-lts/qtbase/src/corelib/kernel/qcoreapplication.cpp:1448 (libQt6Core.so.6+0x1b5347)
          #22 QGuiApplication::exec() /opt/qt-src/qt6.5-lts/qtbase/src/gui/kernel/qguiapplication.cpp:1926 (libQt6Gui.so.6+0x21af86)
          #23 main /opt/Source/Shell/Main.cpp:75 (shell+0x32d4f)
        Thread T50 'QSGRenderThread' (tid=904518, running) created by main thread at:
          #0 pthread_create ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:969 (libtsan.so.0+0x605b8)
          #1 QThread::start(QThread::Priority) /opt/qt-src/qt6.5-lts/qtbase/src/corelib/thread/qthread_unix.cpp:725 (libQt6Core.so.6+0x4a7660)
          #2 QSGThreadedRenderLoop::handleExposure(QQuickWindow*) /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/scenegraph/qsgthreadedrenderloop.cpp:1292 (libQt6Quick.so.6+0x7c59de)
          #3 QSGThreadedRenderLoop::exposureChanged(QQuickWindow*) /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/scenegraph/qsgthreadedrenderloop.cpp:1211 (libQt6Quick.so.6+0x7c70f4)
          #4 QQuickWindow::exposeEvent(QExposeEvent*) /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/items/qquickwindow.cpp:178 (libQt6Quick.so.6+0x39d050)
          #5 QWindow::event(QEvent*) /opt/qt-src/qt6.5-lts/qtbase/src/gui/kernel/qwindow.cpp:2516 (libQt6Gui.so.6+0x2f67ef)
          #6 QQuickWindow::event(QEvent*) /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/items/qquickwindow.cpp:1627 (libQt6Quick.so.6+0x3af742)
          #7 QCoreApplicationPrivate::notify_helper(QObject*, QEvent*) /opt/qt-src/qt6.5-lts/qtbase/src/corelib/kernel/qcoreapplication.cpp:1294 (libQt6Core.so.6+0x1a58aa)
          #8 doNotify /opt/qt-src/qt6.5-lts/qtbase/src/corelib/kernel/qcoreapplication.cpp:1223 (libQt6Core.so.6+0x1a8c97)
          #9 QCoreApplication::notify(QObject*, QEvent*) /opt/qt-src/qt6.5-lts/qtbase/src/corelib/kernel/qcoreapplication.cpp:1206 (libQt6Core.so.6+0x1a8d38)
          #10 QGuiApplication::notify(QObject*, QEvent*) /opt/qt-src/qt6.5-lts/qtbase/src/gui/kernel/qguiapplication.cpp:1994 (libQt6Gui.so.6+0x22d97f)
          #11 QCoreApplication::notifyInternal2(QObject*, QEvent*) /opt/qt-src/qt6.5-lts/qtbase/src/corelib/kernel/qcoreapplication.cpp:1127 (libQt6Core.so.6+0x1a8eb8)
          #12 QCoreApplication::sendSpontaneousEvent(QObject*, QEvent*) /opt/qt-src/qt6.5-lts/qtbase/src/corelib/kernel/qcoreapplication.cpp:1559 (libQt6Core.so.6+0x1a9087)
          #13 QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent*) /opt/qt-src/qt6.5-lts/qtbase/src/gui/kernel/qguiapplication.cpp:3338 (libQt6Gui.so.6+0x23641a)
          #14 QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) /opt/qt-src/qt6.5-lts/qtbase/src/gui/kernel/qguiapplication.cpp:2191 (libQt6Gui.so.6+0x237966)
          #15 QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) /opt/qt-src/qt6.5-lts/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:1094 (libQt6Gui.so.6+0x2fdc9c)
          #16 userEventSourceDispatch /opt/qt-src/qt6.5-lts/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:38 (libQt6Gui.so.6+0xb223bb)
          #17 g_main_context_dispatch <null> (libglib-2.0.so.0+0x55d3a)
          #18 QPAEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) /opt/qt-src/qt6.5-lts/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:87 (libQt6Gui.so.6+0xb226a2)
          #19 QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) /opt/qt-src/qt6.5-lts/qtbase/src/corelib/kernel/qeventloop.cpp:100 (libQt6Core.so.6+0x1bffa5)
          #20 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) /opt/qt-src/qt6.5-lts/qtbase/src/corelib/kernel/qeventloop.cpp:182 (libQt6Core.so.6+0x1c0e98)
          #21 QCoreApplication::exec() /opt/qt-src/qt6.5-lts/qtbase/src/corelib/kernel/qcoreapplication.cpp:1448 (libQt6Core.so.6+0x1b5347)
          #22 QGuiApplication::exec() /opt/qt-src/qt6.5-lts/qtbase/src/gui/kernel/qguiapplication.cpp:1926 (libQt6Gui.so.6+0x21af86)
          #23 main /opt/Source/Shell/Main.cpp:75 (shell+0x32d4f)
      SUMMARY: ThreadSanitizer: data race /opt/qt-src/qt6.5-lts/qtdeclarative/src/quick/scenegraph/coreapi/qsgmaterial.cpp:13 in qsg_test_and_clear_material_failure(
      

       

      ```

      Attachments

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

        Activity

          People

            dfaure_kdab David Faure
            cordlandwehr-work Andreas Cord-Landwehr
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There is 1 open Gerrit change