Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Memory leaks in 6.9.1 that weren't there in 6.9.0
Forum Updated to NodeBB v4.3 + New Features

Memory leaks in 6.9.1 that weren't there in 6.9.0

Scheduled Pinned Locked Moved Solved General and Desktop
13 Posts 4 Posters 341 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • PerdrixP Offline
    PerdrixP Offline
    Perdrix
    wrote last edited by
    #1

    Building my code in Debug mode on WIndows uses Visual Leak Detector, which has proven invaluable over the years in detecting memory leaks.

    Running a Windows Debug build built with 6.9.0 and then closing the application I get:

    The thread 25544 has exited with code 0 (0x0).
    No memory leaks detected.
    Visual Leak Detector is now exiting.
    The program '[63732] DeepSkyStacker.exe' has exited with code 0 (0x0).
    

    If OTOH I build with 6.9.1 it seems that Qt isn't doing its memory cleanup.

    The thread 56164 has exited with code 0 (0x0).
    WARNING: Visual Leak Detector detected memory leaks!
    ---------- Block 623 at 0x000000000293B000: 48 bytes ----------
      Leak Hash: 0x03B19E03, Count: 1, Total 48 bytes
      Call Stack (TID 68304):
        ntdll.dll!RtlAllocateHeap()
        clbcatq.dll!0x00007FFE66085F8F()
        combase.dll!0x00007FFE674049A1()
        combase.dll!CoGetModuleType() + 0x6E5A bytes
        combase.dll!CLSIDFromProgID() + 0xA4B bytes
        combase.dll!RoGetActivationFactory() + 0x352 bytes
        combase.dll!RoGetActivationFactory() + 0x5F bytes
        qwindowsd.dll!0x00007FFD2BF81530()
        qwindowsd.dll!0x00007FFD2BF81330()
        qwindowsd.dll!0x00007FFD2BF81082()
        qwindowsd.dll!0x00007FFD2BF7FF66()
        qwindowsd.dll!0x00007FFD2BF805E4()
        qwindowsd.dll!0x00007FFD2BF85AFA()
        qwindowsd.dll!0x00007FFD2C0107EE()
        qwindowsd.dll!0x00007FFD2C00F6BB()
        qwindowsd.dll!0x00007FFD2C00FBEA()
        qwindowsd.dll!0x00007FFD2C00F604()
        qwindowsd.dll!0x00007FFD2C00DBD9()
        qwindowsd.dll!0x00007FFD2BF7A185()
        C:\Users\qt\work\qt\qtbase\src\gui\kernel\qguiapplication.cpp (1379): Qt6Guid.dll!init_platform() + 0x2F bytes
        C:\Users\qt\work\qt\qtbase\src\gui\kernel\qguiapplication.cpp (1591): Qt6Guid.dll!QGuiApplicationPrivate::createPlatformIntegration() + 0x9A bytes
        C:\Users\qt\work\qt\qtbase\src\gui\kernel\qguiapplication.cpp (1613): Qt6Guid.dll!QGuiApplicationPrivate::createEventDispatcher()
        C:\Users\qt\work\qt\qtbase\src\widgets\kernel\qapplication.cpp (154): Qt6Widgetsd.dll!QApplicationPrivate::createEventDispatcher()
        C:\Users\qt\work\qt\qtbase\src\corelib\kernel\qcoreapplication.cpp (867): Qt6Cored.dll!QCoreApplicationPrivate::init()
        C:\Users\qt\work\qt\qtbase\src\gui\kernel\qguiapplication.cpp (1640): Qt6Guid.dll!QGuiApplicationPrivate::init()
        C:\Users\qt\work\qt\qtbase\src\widgets\kernel\qapplication.cpp (478): Qt6Widgetsd.dll!QApplicationPrivate::init()
        C:\Users\qt\work\qt\qtbase\src\widgets\kernel\qapplication.cpp (465): Qt6Widgetsd.dll!QApplication::QApplication()
        D:\Github\DSS\DeepSkyStacker\DeepSkyStacker.cpp (843): DeepSkyStacker.exe!main() + 0x1E bytes
        C:\Users\qt\work\qt\qtbase\src\entrypoint\qtentrypoint_win.cpp (45): DeepSkyStacker.exe!qtEntryPoint() + 0xE bytes
        C:\Users\qt\work\qt\qtbase\src\entrypoint\qtentrypoint_win.cpp (64): DeepSkyStacker.exe!WinMain()
        D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (107): DeepSkyStacker.exe!invoke_main()
        D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (288): DeepSkyStacker.exe!__scrt_common_main_seh() + 0x5 bytes
        D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (331): DeepSkyStacker.exe!__scrt_common_main()
        D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_winmain.cpp (17): DeepSkyStacker.exe!WinMainCRTStartup()
        KERNEL32.DLL!BaseThreadInitThunk() + 0x17 bytes
        ntdll.dll!RtlUserThreadStart() + 0x2C bytes
      Data:
        88 66 0E 66    FE 7F 00 00    01 00 00 00    DD DD DD DD     .f.f.... ........
        00 00 00 00    00 00 00 00    80 A5 93 02    00 00 00 00     ........ ........
        00 00 00 00    00 00 00 00    01 00 00 00    DD DD DD DD     ........ ........
    
       : 
       : lots of lines omitted
       :
    
    Visual Leak Detector detected 626 memory leaks (74964 bytes).
    Largest number used: 2496521 bytes.
    Total allocations: 38816395 bytes.
    Visual Leak Detector is now exiting.
    The program '[2664] DeepSkyStacker.exe' has exited with code 0 (0x0).
    

    This is a quite nasty regression.

    David

    1 Reply Last reply
    1
    • PerdrixP Offline
      PerdrixP Offline
      Perdrix
      wrote last edited by Perdrix
      #11

      Qt developers think these aren't memory blocks allocated by Qt, but (by inference) allocated by Windows.

      1 Reply Last reply
      0
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote last edited by
        #2

        Install the Qt debug symbols and sources to get a better backtrace, create a minimal, compileable example.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        2
        • joborJ Offline
          joborJ Offline
          jobor
          wrote last edited by
          #3

          Could you please file a bug report? Ideally, with a backtrace after installing the debug symbols via the online installer.

          1 Reply Last reply
          1
          • PerdrixP Offline
            PerdrixP Offline
            Perdrix
            wrote last edited by
            #4

            https://bugreports.qt.io/browse/QTBUG-140502

            Christian EhrlicherC 1 Reply Last reply
            0
            • PerdrixP Perdrix

              https://bugreports.qt.io/browse/QTBUG-140502

              Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote last edited by
              #5

              @Perdrix said in Memory leaks in 6.9.1 that weren't there in 6.9.0:

              https://bugreports.qt.io/browse/QTBUG-140502

              And still no mimimal, compilable example to reproduce the problem...

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              1 Reply Last reply
              0
              • PerdrixP Offline
                PerdrixP Offline
                Perdrix
                wrote last edited by
                #6

                Any program will do that uses new to create Qt objects.

                JonBJ 1 Reply Last reply
                0
                • PerdrixP Perdrix

                  Any program will do that uses new to create Qt objects.

                  JonBJ Offline
                  JonBJ Offline
                  JonB
                  wrote last edited by JonB
                  #7

                  @Perdrix
                  But if you want the devs to actually look at it you need to supply some complete, minimal program which shows that. Devs expect to copy, paste, compile, run, see behaviour, investigate. If you say it is so easy to reproduce that should not be hard. Otherwise I would not rely on them looking into it.

                  1 Reply Last reply
                  1
                  • PerdrixP Offline
                    PerdrixP Offline
                    Perdrix
                    wrote last edited by
                    #8

                    I thought it was trivial to reproduce - but my initial stab at a test case shows I was wrong - I am working on a test case that does show the problem.

                    JonBJ 1 Reply Last reply
                    1
                    • PerdrixP Perdrix

                      I thought it was trivial to reproduce - but my initial stab at a test case shows I was wrong - I am working on a test case that does show the problem.

                      JonBJ Offline
                      JonBJ Offline
                      JonB
                      wrote last edited by
                      #9

                      @Perdrix That's why they always want a complete repro... :)

                      1 Reply Last reply
                      0
                      • PerdrixP Offline
                        PerdrixP Offline
                        Perdrix
                        wrote last edited by
                        #10

                        Test case added to bug report

                        1 Reply Last reply
                        1
                        • PerdrixP Offline
                          PerdrixP Offline
                          Perdrix
                          wrote last edited by Perdrix
                          #11

                          Qt developers think these aren't memory blocks allocated by Qt, but (by inference) allocated by Windows.

                          1 Reply Last reply
                          0
                          • PerdrixP Perdrix has marked this topic as solved
                          • Christian EhrlicherC Offline
                            Christian EhrlicherC Offline
                            Christian Ehrlicher
                            Lifetime Qt Champion
                            wrote last edited by
                            #12

                            The problem is - the initial report and the testcase do not match and 90% of the vld report don't even have a Qt dll anywhere in the backtrace so it's hard to see where Qt should be involved here.
                            As I wrote in my first post - install the Qt debug symbols so we can at least see where exactly in the Qt source the leak should be as it's not reproducible/is different with your test application

                            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                            Visit the Qt Academy at https://academy.qt.io/catalog

                            1 Reply Last reply
                            1
                            • PerdrixP Offline
                              PerdrixP Offline
                              Perdrix
                              wrote last edited by
                              #13

                              I accept that this isn't Qt !

                              1 Reply Last reply
                              0

                              • Login

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • Users
                              • Groups
                              • Search
                              • Get Qt Extensions
                              • Unsolved