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

QOpenGLProgramBinaryCache is not thread safe, but is used statically, potentially from multiple threads

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.12.5, 5.14.0 Alpha
    • 5.12.3
    • GUI: OpenGL
    • None
    • Windows
    • 257bd49c1f47ba5fca6930082fdcf108f9d24e3f (qt/qtbase/5.12)

      https://code.woboq.org/qt5/qtbase/src/gui/opengl/qopenglshaderprogram.cpp.html#3818 declares a single static cache object for all QOpenGLShaderProgram instances.  My application uses multiple different threads to render QML UI to offscreen surfaces, with each QML context associated with it's own rendering thread per the documentation for QQuickRenderControl:  https://doc.qt.io/qt-5/qquickrendercontrol.html 

       

      I'm seeing occasional crashes with a stack trace that ends in QOpenGLProgramBinaryCache::load, line 326, which is calling into QCache and QHash.  I haven't been able to reproduce this in a debugger yet, but I assume that the lack of locking around `m_memCache` in the load function means that QOpenGLProgramBinaryCache isn't thread safe.

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

            lagocs Laszlo Agocs
            jherico Bradley Austin Davis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes