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

QOpenGLFramebufferObject seems to leak QOpenGLSharedResourceGuards

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.9.0 Beta2
    • GUI: OpenGL
    • 7a1cd692e (dev), b615c477f (dev), 2886996de (6.9), b2feff382 (6.9), ada6505aa (6.8), 5852e3393 (6.8), 7169f636b (tqtc/lts-6.5), 0a749412d (tqtc/lts-6.5), 46a5da027 (tqtc/lts-5.15), 24b2b5818 (tqtc/lts-5.15)

    Description

      After fixing all the test-induced memory leaks¹, asan still reports two leaks:

      $ tests/auto/gui/qopengl/tst_qopengl
      ********* Start testing of tst_QOpenGL *********
      Config: Using QtTest library 6.10.0, Qt 6.10.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 11.2.1 20211211), ubuntu 20.04
      PASS   : tst_QOpenGL::initTestCase()
      PASS   : tst_QOpenGL::sharedResourceCleanup(Using QWindow)
      PASS   : tst_QOpenGL::sharedResourceCleanup(Using QOffscreenSurface)
      PASS   : tst_QOpenGL::multiGroupSharedResourceCleanup(Using QWindow)
      PASS   : tst_QOpenGL::multiGroupSharedResourceCleanup(Using QOffscreenSurface)
      PASS   : tst_QOpenGL::multiGroupSharedResourceCleanupCustom(Using QWindow)
      PASS   : tst_QOpenGL::multiGroupSharedResourceCleanupCustom(Using QOffscreenSurface)
      PASS   : tst_QOpenGL::fboSimpleRendering(Using QWindow)
      PASS   : tst_QOpenGL::fboSimpleRendering(Using QOffscreenSurface)
      PASS   : tst_QOpenGL::fboTextureOwnership(Using QWindow)
      PASS   : tst_QOpenGL::fboTextureOwnership(Using QOffscreenSurface)
      PASS   : tst_QOpenGL::fboRendering(Using QWindow)
      PASS   : tst_QOpenGL::fboRendering(Using QOffscreenSurface)
      PASS   : tst_QOpenGL::fboRenderingRGB30(Using QWindow)
      PASS   : tst_QOpenGL::fboRenderingRGB30(Using QOffscreenSurface)
      PASS   : tst_QOpenGL::fboRenderingRGB64(Using QWindow)
      PASS   : tst_QOpenGL::fboRenderingRGB64(Using QOffscreenSurface)
      PASS   : tst_QOpenGL::fboHandleNulledAfterContextDestroyed()
      PASS   : tst_QOpenGL::fboMRT()
      PASS   : tst_QOpenGL::fboMRT_differentFormats()
      PASS   : tst_QOpenGL::openGLPaintDevice(Using QWindow - RGB32)
      PASS   : tst_QOpenGL::openGLPaintDevice(Using QOffscreenSurface - RGB32)
      PASS   : tst_QOpenGL::openGLPaintDevice(Using QOffscreenSurface - RGBx8888)
      PASS   : tst_QOpenGL::openGLPaintDevice(Using QOffscreenSurface - RGB888)
      PASS   : tst_QOpenGL::openGLPaintDevice(Using QOffscreenSurface - RGB16)
      PASS   : tst_QOpenGL::openGLPaintDeviceWithChangingContext()
      PASS   : tst_QOpenGL::aboutToBeDestroyed()
      PASS   : tst_QOpenGL::sizeLessWindow()
      PASS   : tst_QOpenGL::QTBUG15621_triangulatingStrokerDivZero()
      PASS   : tst_QOpenGL::textureblitterFullSourceRectTransform()
      PASS   : tst_QOpenGL::textureblitterPartOriginBottomLeftSourceRectTransform()
      PASS   : tst_QOpenGL::textureblitterPartOriginTopLeftSourceRectTransform()
      PASS   : tst_QOpenGL::textureblitterFullTargetRectTransform()
      PASS   : tst_QOpenGL::textureblitterPartTargetRectTransform()
      PASS   : tst_QOpenGL::defaultSurfaceFormat()
      PASS   : tst_QOpenGL::imageFormatPainting()
      QWARN  : tst_QOpenGL::nullTextureInitializtion() QOpenGLTexture::setData() tried to set a null image
      PASS   : tst_QOpenGL::nullTextureInitializtion()
      PASS   : tst_QOpenGL::clipRect()
      PASS   : tst_QOpenGL::glxContextWrap()
      PASS   : tst_QOpenGL::vaoCreate()
      PASS   : tst_QOpenGL::bufferCreate()
      PASS   : tst_QOpenGL::bufferMapRange()
      PASS   : tst_QOpenGL::defaultQGLCurrentBuffer()
      SKIP   : tst_QOpenGL::dontCrashOnInvalidContextThreadTeardown() Need an egl context for this test
         Loc: [/home/marc/Qt/qtbase-submit/tests/auto/gui/qopengl/tst_qopengl.cpp(1770)]
      PASS   : tst_QOpenGL::cleanupTestCase()
      Totals: 44 passed, 0 failed, 1 skipped, 0 blacklisted, 874ms
      ********* Finished testing of tst_QOpenGL *********
      
      =================================================================
      ==1259283==ERROR: LeakSanitizer: detected memory leaks
      
      Direct leak of 64 byte(s) in 2 object(s) allocated from:
          #0 0x7f5fc9aaaf37 in operator new(unsigned long) ../../../../gcc/libsanitizer/asan/asan_new_delete.cpp:99
          #1 0x7f5fc8cfa029 in QOpenGLFramebufferObjectPrivate::initTexture(int) /home/marc/Qt/qtbase-submit/src/opengl/qopenglframebufferobject.cpp:588
          #2 0x7f5fc8d04615 in QOpenGLFramebufferObjectPrivate::init(QOpenGLFramebufferObject*, QSize const&, QOpenGLFramebufferObject::Attachment, unsigned int, unsigned int, int, bool) /home/marc/Qt/qtbase-submit/src/opengl/qopenglframebufferobject.cpp:514
          #3 0x7f5fc8d07dbd in QOpenGLFramebufferObject::QOpenGLFramebufferObject(QSize const&, QOpenGLFramebufferObjectFormat const&) /home/marc/Qt/qtbase-submit/src/opengl/qopenglframebufferobject.cpp:953
          #4 0x7f5fc8d08467 in QOpenGLFramebufferObject::QOpenGLFramebufferObject(int, int, QOpenGLFramebufferObjectFormat const&) /home/marc/Qt/qtbase-submit/src/opengl/qopenglframebufferobject.cpp:964
          #5 0x55ae3c4665d3 in std::_MakeUniq<QOpenGLFramebufferObject>::__single_object std::make_unique<QOpenGLFramebufferObject, int, int, QOpenGLFramebufferObjectFormat&>(int&&, int&&, QOpenGLFramebufferObjectFormat&) /d/gcc/11/include/c++/11.2.1/bits/unique_ptr.h:962
          #6 0x55ae3c4665d3 in tst_QOpenGL::fboTextureOwnership() /home/marc/Qt/qtbase-submit/tests/auto/gui/qopengl/tst_qopengl.cpp:493
          #7 0x55ae3c494a9e in tst_QOpenGL::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) /home/marc/Qt/qtbase-submit-build/tests/auto/gui/qopengl/tst_qopengl_autogen/include/tst_qopengl.moc:201
          #8 0x55ae3c495b53 in tst_QOpenGL::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) /home/marc/Qt/qtbase-submit-build/tests/auto/gui/qopengl/tst_qopengl_autogen/include/tst_qopengl.moc:189
          #9 0x7f5fa65f8ceb in QMetaMethodInvoker::invokeImpl(QMetaMethod, void*, Qt::ConnectionType, long long, void const* const*, char const* const*, QtPrivate::QMetaTypeInterface const* const*) /home/marc/Qt/qtbase-submit/src/corelib/kernel/qmetaobject.cpp:2801
          #10 0x7f5fa66024fd in QMetaMethod::invokeImpl(QMetaMethod, void*, Qt::ConnectionType, long long, void const* const*, char const* const*, QtPrivate::QMetaTypeInterface const* const*) /home/marc/Qt/qtbase-submit/src/corelib/kernel/qmetaobject.cpp:2640
          #11 0x7f5fc7e08420 in std::enable_if<!std::disjunction<>::value, bool>::type QMetaMethod::invoke<void>(QObject*, Qt::ConnectionType, QTemplatedMetaMethodReturnArgument<void>) const /home/marc/Qt/qtbase-submit/src/corelib/kernel/qmetaobject.h:150
          #12 0x7f5fc7e08420 in std::enable_if<!std::disjunction<>::value, bool>::type QMetaMethod::invoke<>(QObject*, Qt::ConnectionType) const /home/marc/Qt/qtbase-submit/src/corelib/kernel/qmetaobject.h:162
          #13 0x7f5fc7e08420 in invokeTestMethodIfValid /home/marc/Qt/qtbase-submit/src/testlib/qtestcase.cpp:434
          #14 0x7f5fc7e5763a in QTest::TestMethods::invokeTestOnData(int) const /home/marc/Qt/qtbase-submit/src/testlib/qtestcase.cpp:1050
          #15 0x7f5fc7e5f4f7 in operator() /home/marc/Qt/qtbase-submit/src/testlib/qtestcase.cpp:1368
          #16 0x7f5fc7e5f4f7 in runWithWatchdog<QTest::TestMethods::invokeTest(int, QLatin1StringView, std::optional<QTest::WatchDog>&) const::<lambda()> > /home/marc/Qt/qtbase-submit/src/testlib/qtestcase.cpp:1251
          #17 0x7f5fc7e5f4f7 in QTest::TestMethods::invokeTest(int, QLatin1String, std::optional<QTest::WatchDog>&) const /home/marc/Qt/qtbase-submit/src/testlib/qtestcase.cpp:1367
          #18 0x7f5fc7e640ab in QTest::TestMethods::invokeTests(QObject*) const /home/marc/Qt/qtbase-submit/src/testlib/qtestcase.cpp:1710
          #19 0x7f5fc7e69914 in QTest::qRun() /home/marc/Qt/qtbase-submit/src/testlib/qtestcase.cpp:1951
          #20 0x7f5fc7e6bac7 in QTest::qExec(QObject*, int, char**) /home/marc/Qt/qtbase-submit/src/testlib/qtestcase.cpp:1823
          #21 0x55ae3c43e8f7 in main /home/marc/Qt/qtbase-submit/tests/auto/gui/qopengl/tst_qopengl.cpp:1782
          #22 0x7f5f9fd77082 in __libc_start_main ../csu/libc-start.c:308
      
      SUMMARY: AddressSanitizer: 64 byte(s) leaked in 2 allocation(s).
      

      This is with a incremental build, so there might be some issue with the plugin.Leak persists after a full rebuild.

      Line numbers are as of [¹].

      ¹ https://codereview.qt-project.org/c/qt/qtbase/+/630278/1

      Attachments

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

        Activity

          People

            lagocs Laszlo Agocs
            mmutz Marc Mutz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: