[Development] QtQuick/QtGui/QtCore leak on exit

William Hallatt goblincoding at gmail.com
Wed Nov 5 14:17:22 CET 2014


Hi everyone,

I have a QtQuick app (that links against external MS MFC libraries) that
triggers memory leak warnings on exit.

I have run the test app through both Dr Memory as well as BoundsChecker
(both in VS 2008) and both report memory leaks stemming from the QtQuick
and QtCore libraries.

The only related information I have been able to find is this:

http://doc.qt.digia.com/solutions/4/qtwinmigrate/winmigrate-walkthrough.html#a-note-about-mfc-s-memory-leak-detection

Which (1) is not completely relevant to my situation and (2) might be
outdated information.

Could I safely assume that these are false positives?  I am not overly
concerned since the leaks are tiny and only on exit, but the object dump to
stdout is a bit annoying.

Unfortunately the best I can do is to attach the results file from Dr
Memory.

I'm happy to provide additional information if required (excluding source).

Kind regards,
William Hallatt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20141105/bf31a4d8/attachment.html>
-------------- next part --------------
Dr. Memory version 1.8.0 build 8 built on Sep  9 2014 16:27:02
Dr. Memory results for pid 4152: "test.exe"
Application cmdline: "C:\QtDev\test\test\Deploy\test.exe"
Recorded 108 suppression(s) from default C:\DrMemory\bin\suppress-default.txt

Error #1: UNINITIALIZED READ: reading register eflags
replace_memcmp 
    d:\drmemory_package\drmemory\replace.c(777):
libGLESv2d.dll!rx::Renderer9::setViewport
    c:\qt\qt5build\qtbase\src\3rdparty\angle\src\libglesv2\renderer\d3d9\renderer9.cpp(1141):
libGLESv2d.dll!gl::Context::applyRenderTarget
    c:\qt\qt5build\qtbase\src\3rdparty\angle\src\libglesv2\context.cpp(1733):
libGLESv2d.dll!gl::Context::clear
    c:\qt\qt5build\qtbase\src\3rdparty\angle\src\libglesv2\context.cpp(1943):
libGLESv2d.dll!glClear       
    c:\qt\qt5build\qtbase\src\3rdparty\angle\src\libglesv2\libglesv2.cpp(870):
Qt5Quickd.dll!QSGBindable::clear
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\coreapi\qsgrenderer.cpp(79):
Qt5Quickd.dll!QSGBatchRenderer::Renderer::renderBatches
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\coreapi\qsgbatchrenderer.cpp(2246):
Qt5Quickd.dll!QSGBatchRenderer::Renderer::render
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\coreapi\qsgbatchrenderer.cpp(2433):
Qt5Quickd.dll!QSGRenderer::renderScene
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\coreapi\qsgrenderer.cpp(261):
Qt5Quickd.dll!QSGRenderer::renderScene
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\coreapi\qsgrenderer.cpp(220):
Qt5Quickd.dll!QSGRenderContext::renderNextFrame
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\qsgcontext.cpp(356):
Qt5Quickd.dll!QQuickWindowPrivate::renderSceneGraph
    c:\qt\qt5build\qtdeclarative\src\quick\items\qquickwindow.cpp(386):
Qt5Quickd.dll!QSGWindowsRenderLoop::renderWindow
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\qsgwindowsrenderloop.cpp(458):
Qt5Quickd.dll!QSGWindowsRenderLoop::render
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\qsgwindowsrenderloop.cpp(398):
Qt5Quickd.dll!QSGWindowsRenderLoop::exposureChanged
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\qsgwindowsrenderloop.cpp(315):
Qt5Quickd.dll!QQuickWindow::exposeEvent
    c:\qt\qt5build\qtdeclarative\src\quick\items\qquickwindow.cpp(216):
Qt5Guid.dll!QWindow::event
    c:\qt\qt5build\qtbase\src\gui\kernel\qwindow.cpp(1956):
Qt5Quickd.dll!QQuickWindow::event
    c:\qt\qt5build\qtdeclarative\src\quick\items\qquickwindow.cpp(1348):
Qt5Cored.dll!QCoreApplicationPrivate::notify_helper
    c:\qt\qt5build\qtbase\src\corelib\kernel\qcoreapplication.cpp(1052):
Qt5Cored.dll!QCoreApplication::notify
    c:\qt\qt5build\qtbase\src\corelib\kernel\qcoreapplication.cpp(997):

Error #2: UNINITIALIZED READ: reading register eax
libGLESv2d.dll!rx::Renderer9::setViewport
    c:\qt\qt5build\qtbase\src\3rdparty\angle\src\libglesv2\renderer\d3d9\renderer9.cpp(1141):
libGLESv2d.dll!gl::Context::applyRenderTarget
    c:\qt\qt5build\qtbase\src\3rdparty\angle\src\libglesv2\context.cpp(1733):
libGLESv2d.dll!gl::Context::clear
    c:\qt\qt5build\qtbase\src\3rdparty\angle\src\libglesv2\context.cpp(1943):
libGLESv2d.dll!glClear       
    c:\qt\qt5build\qtbase\src\3rdparty\angle\src\libglesv2\libglesv2.cpp(870):
Qt5Quickd.dll!QSGBindable::clear
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\coreapi\qsgrenderer.cpp(79):
Qt5Quickd.dll!QSGBatchRenderer::Renderer::renderBatches
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\coreapi\qsgbatchrenderer.cpp(2246):
Qt5Quickd.dll!QSGBatchRenderer::Renderer::render
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\coreapi\qsgbatchrenderer.cpp(2433):
Qt5Quickd.dll!QSGRenderer::renderScene
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\coreapi\qsgrenderer.cpp(261):
Qt5Quickd.dll!QSGRenderer::renderScene
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\coreapi\qsgrenderer.cpp(220):
Qt5Quickd.dll!QSGRenderContext::renderNextFrame
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\qsgcontext.cpp(356):
Qt5Quickd.dll!QQuickWindowPrivate::renderSceneGraph
    c:\qt\qt5build\qtdeclarative\src\quick\items\qquickwindow.cpp(386):
Qt5Quickd.dll!QSGWindowsRenderLoop::renderWindow
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\qsgwindowsrenderloop.cpp(458):
Qt5Quickd.dll!QSGWindowsRenderLoop::render
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\qsgwindowsrenderloop.cpp(398):
Qt5Quickd.dll!QSGWindowsRenderLoop::exposureChanged
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\qsgwindowsrenderloop.cpp(315):
Qt5Quickd.dll!QQuickWindow::exposeEvent
    c:\qt\qt5build\qtdeclarative\src\quick\items\qquickwindow.cpp(216):
Qt5Guid.dll!QWindow::event
    c:\qt\qt5build\qtbase\src\gui\kernel\qwindow.cpp(1956):
Qt5Quickd.dll!QQuickWindow::event
    c:\qt\qt5build\qtdeclarative\src\quick\items\qquickwindow.cpp(1348):
Qt5Cored.dll!QCoreApplicationPrivate::notify_helper
    c:\qt\qt5build\qtbase\src\corelib\kernel\qcoreapplication.cpp(1052):
Qt5Cored.dll!QCoreApplication::notify
    c:\qt\qt5build\qtbase\src\corelib\kernel\qcoreapplication.cpp(997):
Qt5Guid.dll!QGuiApplication::notify
    c:\qt\qt5build\qtbase\src\gui\kernel\qguiapplication.cpp(1471):

Error #3: UNINITIALIZED READ: reading register eflags
replace_memcmp 
    d:\drmemory_package\drmemory\replace.c(777):
libGLESv2d.dll!rx::Renderer9::setViewport
    c:\qt\qt5build\qtbase\src\3rdparty\angle\src\libglesv2\renderer\d3d9\renderer9.cpp(1147):
libGLESv2d.dll!gl::Context::applyRenderTarget
    c:\qt\qt5build\qtbase\src\3rdparty\angle\src\libglesv2\context.cpp(1733):
libGLESv2d.dll!gl::Context::clear
    c:\qt\qt5build\qtbase\src\3rdparty\angle\src\libglesv2\context.cpp(1943):
libGLESv2d.dll!glClear       
    c:\qt\qt5build\qtbase\src\3rdparty\angle\src\libglesv2\libglesv2.cpp(870):
Qt5Quickd.dll!QSGBindable::clear
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\coreapi\qsgrenderer.cpp(79):
Qt5Quickd.dll!QSGBatchRenderer::Renderer::renderBatches
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\coreapi\qsgbatchrenderer.cpp(2246):
Qt5Quickd.dll!QSGBatchRenderer::Renderer::render
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\coreapi\qsgbatchrenderer.cpp(2433):
Qt5Quickd.dll!QSGRenderer::renderScene
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\coreapi\qsgrenderer.cpp(261):
Qt5Quickd.dll!QSGRenderer::renderScene
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\coreapi\qsgrenderer.cpp(220):
Qt5Quickd.dll!QSGRenderContext::renderNextFrame
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\qsgcontext.cpp(356):
Qt5Quickd.dll!QQuickWindowPrivate::renderSceneGraph
    c:\qt\qt5build\qtdeclarative\src\quick\items\qquickwindow.cpp(386):
Qt5Quickd.dll!QSGWindowsRenderLoop::renderWindow
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\qsgwindowsrenderloop.cpp(458):
Qt5Quickd.dll!QSGWindowsRenderLoop::render
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\qsgwindowsrenderloop.cpp(398):
Qt5Quickd.dll!QSGWindowsRenderLoop::exposureChanged
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\qsgwindowsrenderloop.cpp(315):
Qt5Quickd.dll!QQuickWindow::exposeEvent
    c:\qt\qt5build\qtdeclarative\src\quick\items\qquickwindow.cpp(216):
Qt5Guid.dll!QWindow::event
    c:\qt\qt5build\qtbase\src\gui\kernel\qwindow.cpp(1956):
Qt5Quickd.dll!QQuickWindow::event
    c:\qt\qt5build\qtdeclarative\src\quick\items\qquickwindow.cpp(1348):
Qt5Cored.dll!QCoreApplicationPrivate::notify_helper
    c:\qt\qt5build\qtbase\src\corelib\kernel\qcoreapplication.cpp(1052):
Qt5Cored.dll!QCoreApplication::notify
    c:\qt\qt5build\qtbase\src\corelib\kernel\qcoreapplication.cpp(997):

Error #4: UNINITIALIZED READ: reading register eax
libGLESv2d.dll!rx::Renderer9::setViewport
    c:\qt\qt5build\qtbase\src\3rdparty\angle\src\libglesv2\renderer\d3d9\renderer9.cpp(1147):
libGLESv2d.dll!gl::Context::applyRenderTarget
    c:\qt\qt5build\qtbase\src\3rdparty\angle\src\libglesv2\context.cpp(1733):
libGLESv2d.dll!gl::Context::clear
    c:\qt\qt5build\qtbase\src\3rdparty\angle\src\libglesv2\context.cpp(1943):
libGLESv2d.dll!glClear       
    c:\qt\qt5build\qtbase\src\3rdparty\angle\src\libglesv2\libglesv2.cpp(870):
Qt5Quickd.dll!QSGBindable::clear
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\coreapi\qsgrenderer.cpp(79):
Qt5Quickd.dll!QSGBatchRenderer::Renderer::renderBatches
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\coreapi\qsgbatchrenderer.cpp(2246):
Qt5Quickd.dll!QSGBatchRenderer::Renderer::render
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\coreapi\qsgbatchrenderer.cpp(2433):
Qt5Quickd.dll!QSGRenderer::renderScene
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\coreapi\qsgrenderer.cpp(261):
Qt5Quickd.dll!QSGRenderer::renderScene
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\coreapi\qsgrenderer.cpp(220):
Qt5Quickd.dll!QSGRenderContext::renderNextFrame
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\qsgcontext.cpp(356):
Qt5Quickd.dll!QQuickWindowPrivate::renderSceneGraph
    c:\qt\qt5build\qtdeclarative\src\quick\items\qquickwindow.cpp(386):
Qt5Quickd.dll!QSGWindowsRenderLoop::renderWindow
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\qsgwindowsrenderloop.cpp(458):
Qt5Quickd.dll!QSGWindowsRenderLoop::render
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\qsgwindowsrenderloop.cpp(398):
Qt5Quickd.dll!QSGWindowsRenderLoop::exposureChanged
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\qsgwindowsrenderloop.cpp(315):
Qt5Quickd.dll!QQuickWindow::exposeEvent
    c:\qt\qt5build\qtdeclarative\src\quick\items\qquickwindow.cpp(216):
Qt5Guid.dll!QWindow::event
    c:\qt\qt5build\qtbase\src\gui\kernel\qwindow.cpp(1956):
Qt5Quickd.dll!QQuickWindow::event
    c:\qt\qt5build\qtdeclarative\src\quick\items\qquickwindow.cpp(1348):
Qt5Cored.dll!QCoreApplicationPrivate::notify_helper
    c:\qt\qt5build\qtbase\src\corelib\kernel\qcoreapplication.cpp(1052):
Qt5Cored.dll!QCoreApplication::notify
    c:\qt\qt5build\qtbase\src\corelib\kernel\qcoreapplication.cpp(997):
Qt5Guid.dll!QGuiApplication::notify
    c:\qt\qt5build\qtbase\src\gui\kernel\qguiapplication.cpp(1471):

Error #5: LEAK 8 bytes 
replace_RtlAllocateHeap
    d:\drmemory_package\common\alloc_replace.c(3432):
KERNELBASE.dll!LocalAlloc    
    ??:0
libGLESv2d.dll!gl::AllocateCurrent
    c:\qt\qt5build\qtbase\src\3rdparty\angle\src\libglesv2\main.cpp(26):
libGLESv2d.dll!DllMain       
    c:\qt\qt5build\qtbase\src\3rdparty\angle\src\libglesv2\main.cpp(89):
libGLESv2d.dll!__DllMainCRTStartup
    ??:0
libGLESv2d.dll!_DllMainCRTStartup
    ??:0
ntdll.dll!RtlQueryEnvironmentVariable
    ??:0
ntdll.dll!RtlAllocateActivationContextStack
    ??:0
ntdll.dll!RtlDecodePointer
    ??:0
ntdll.dll!LdrInitializeThunk
    ??:0

Error #6: LEAK 20 bytes 
replace_RtlAllocateHeap
    d:\drmemory_package\common\alloc_replace.c(3432):
KERNELBASE.dll!LocalAlloc    
    ??:0
libEGLd.dll!egl::AllocateCurrent
    c:\qt\qt5build\qtbase\src\3rdparty\angle\src\libegl\main.cpp(26):
libEGLd.dll!DllMain    
    c:\qt\qt5build\qtbase\src\3rdparty\angle\src\libegl\main.cpp(106):
libEGLd.dll!__DllMainCRTStartup
    ??:0
libEGLd.dll!_DllMainCRTStartup
    ??:0
ntdll.dll!RtlQueryEnvironmentVariable
    ??:0
ntdll.dll!RtlAllocateActivationContextStack
    ??:0
ntdll.dll!RtlDecodePointer
    ??:0
ntdll.dll!LdrInitializeThunk
    ??:0

Error #7: LEAK 160 direct bytes + 1440 indirect bytes
replace_operator_new
    d:\drmemory_package\common\alloc_replace.c(2609):
libEGLd.dll!std::_Allocate<>
    ??:0
libEGLd.dll!std::allocator<>::allocate
    ??:0
libEGLd.dll!std::_Tree<>::_Buynode
    ??:0
libEGLd.dll!std::_Tree<>::_Insert
    ??:0
libEGLd.dll!std::_Tree<>::insert
    ??:0
libEGLd.dll!egl::Display::initialize
    c:\qt\qt5build\qtbase\src\3rdparty\angle\src\libegl\display.cpp(104):
libEGLd.dll!eglInitialize
    c:\qt\qt5build\qtbase\src\3rdparty\angle\src\libegl\libegl.cpp(126):
qwindowsd.dll!QWindowsEGLStaticContext::create
    c:\qt\qt5build\qtbase\src\plugins\platforms\windows\qwindowseglcontext.cpp(87):
qwindowsd.dll!QWindowsIntegration::createPlatformOpenGLContext
    c:\qt\qt5build\qtbase\src\plugins\platforms\windows\qwindowsintegration.cpp(313):
Qt5Guid.dll!QOpenGLContext::create
    c:\qt\qt5build\qtbase\src\gui\kernel\qopenglcontext.cpp(512):
Qt5Quickd.dll!QSGWindowsRenderLoop::show
    c:\qt\qt5build\qtdeclarative\src\quick\scenegraph\qsgwindowsrenderloop.cpp(184):

Error #8: LEAK 16 direct bytes + 624 indirect bytes
replace_operator_new
    d:\drmemory_package\common\alloc_replace.c(2609):
Qt5Qmld.dll!QQmlImportDatabase::importDynamicPlugin
    c:\qt\qt5build\qtdeclarative\src\qml\qml\qqmlimport.cpp(1985):
Qt5Qmld.dll!QQmlImportsPrivate::importExtension
    c:\qt\qt5build\qtdeclarative\src\qml\qml\qqmlimport.cpp(917):
Qt5Qmld.dll!QQmlImportsPrivate::addLibraryImport
    c:\qt\qt5build\qtdeclarative\src\qml\qml\qqmlimport.cpp(1262):
Qt5Qmld.dll!QQmlImports::addLibraryImport
    c:\qt\qt5build\qtdeclarative\src\qml\qml\qqmlimport.cpp(1516):
Qt5Qmld.dll!QQmlTypeLoader::Blob::addImport
    c:\qt\qt5build\qtdeclarative\src\qml\qml\qqmltypeloader.cpp(1330):
Qt5Qmld.dll!QQmlTypeData::continueLoadFromIR
    c:\qt\qt5build\qtdeclarative\src\qml\qml\qqmltypeloader.cpp(2267):
Qt5Qmld.dll!QQmlTypeData::dataReceived
    c:\qt\qt5build\qtdeclarative\src\qml\qml\qqmltypeloader.cpp(2224):
Qt5Qmld.dll!QQmlDataLoader::setData
    c:\qt\qt5build\qtdeclarative\src\qml\qml\qqmltypeloader.cpp(1198):
Qt5Qmld.dll!QQmlDataLoader::setData
    c:\qt\qt5build\qtdeclarative\src\qml\qml\qqmltypeloader.cpp(1190):
Qt5Qmld.dll!QQmlDataLoader::loadThread
    c:\qt\qt5build\qtdeclarative\src\qml\qml\qqmltypeloader.cpp(1068):
Qt5Qmld.dll!QQmlDataLoaderThread::loadThread
    c:\qt\qt5build\qtdeclarative\src\qml\qml\qqmltypeloader.cpp(816):

===========================================================================
FINAL SUMMARY:

DUPLICATE ERROR COUNTS:
	Error #   5:      8
	Error #   6:      8

SUPPRESSIONS USED:

ERRORS FOUND:
      0 unique,     0 total unaddressable access(es)
      4 unique,     4 total uninitialized access(es)
      0 unique,     0 total invalid heap argument(s)
      0 unique,     0 total GDI usage error(s)
      0 unique,     0 total handle leak(s)
      0 unique,     0 total warning(s)
      4 unique,    18 total,   2464 byte(s) of leak(s)
      0 unique,     0 total,      0 byte(s) of possible leak(s)
Details: C:\DrMemory\drmemory\logs\DrMemory-test.exe.4152.000\results.txt


More information about the Development mailing list