Leaked memory object
-
I've recently started getting reports of a memory leak from Visual Leak Detector.
All the other known and unavoidable leaks (from static objects) are reported like this:
---------- Block 532 at 0x00000000005B1580: 24 bytes ---------- Leak Hash: 0x14515E6A, Count: 1, Total 24 bytes Call Stack (TID 4408): mfc140ud.dll!0x00007FFDCEB931E0() C:\Users\amonra\Documents\GitHub\DSS\ZCLass\Source\ZExcBase.cpp (124): DeepSkyStacker.exe!traceFunction_Lock() + 0xA bytes C:\Users\amonra\Documents\GitHub\DSS\ZCLass\Source\ZExcBase.cpp (596): DeepSkyStacker.exe!ZException::setTraceFunction() + 0x5 bytes C:\Users\amonra\Documents\GitHub\DSS\ZCLass\Source\ZTrace.cpp (173): DeepSkyStacker.exe!ZTrace_Init::ZTrace_Init() C:\Users\amonra\Documents\GitHub\DSS\ZCLass\Source\ZTrace.cpp (202): DeepSkyStacker.exe!ZTraceSetup::traceOn() + 0x21 bytes C:\Users\amonra\Documents\GitHub\DSS\ZCLass\Source\ZTrace.cpp (232): DeepSkyStacker.exe!ZTrace::ZTrace() + 0x5 bytes C:\Users\amonra\Documents\GitHub\DSS\DeepSkyStacker\DeepSkyStacker.cpp (931): DeepSkyStacker.exe!main() + 0x21 bytes C:\Users\qt\work\qt\qtbase\src\entrypoint\qtentrypoint_win.cpp (50): DeepSkyStacker.exe!qtEntryPoint() + 0xE bytes C:\Users\qt\work\qt\qtbase\src\entrypoint\qtentrypoint_win.cpp (60): 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() + 0x1D bytes ntdll.dll!RtlUserThreadStart() + 0x28 bytes Data: A8 C7 A9 40 01 00 00 00 00 00 00 00 00 00 00 00 ...@.... ........ B0 02 00 00 00 00 00 00 ........ ........Instead all I see is:
---------- Block 9961 at 0x000000000A27EE40: 128 bytes ---------- Leak Hash: 0x9C7787F5, Count: 1, Total 128 bytes Call Stack (TID 4408): Data: D0 1C 16 0A 00 00 00 00 D0 26 35 0A 00 00 00 00 ........ .&5..... 20 1E 16 0A 00 00 00 00 90 22 15 0A 00 00 00 00 ........ ."...... 90 1B 35 0A 00 00 00 00 50 32 15 0A 00 00 00 00 ..5..... P2...... 70 2A 15 0A 00 00 00 00 40 21 15 0A 00 00 00 00 p*...... @!...... 50 1C 35 0A 00 00 00 00 20 22 15 0A 00 00 00 00 P.5..... ."...... A0 2C 15 0A 00 00 00 00 F0 3B 15 0A 00 00 00 00 .,...... .;...... B0 1C 35 0A 00 00 00 00 20 29 15 0A 00 00 00 00 ..5..... .)...... 30 33 15 0A 00 00 00 00 30 2C 15 0A 00 00 00 00 03...... 0,......which looks like an array or vector of 16 pointers. Without a call stack its a bit hard to track down.
Does anyone recognise where that might come from?
-
OK, then make sure you have Qt installed with "Qt Debug Information Files" selected in Qt Maintenance Tool.
If the problem persists then I have no idea :-(
@sierdzio I managed to get an stack trace by changing the vld.ini file to log in Unicode and to a file, instead of in ascii to the debugger.
That did produce the necessary stack trace! The leak turned out to be a "ui" object that belonged to a QDialog that was created with the application QMainWindow (which was a stack object in main()) as its parent.
I don't understand why that was done rather then making the object that created it the parent (I need to discuss that with the developer).
I don't quite understand why it wasn't cleaned up when the QMainWindow went out of scope at the end of main().
Thanks all,
David -
I've recently started getting reports of a memory leak from Visual Leak Detector.
All the other known and unavoidable leaks (from static objects) are reported like this:
---------- Block 532 at 0x00000000005B1580: 24 bytes ---------- Leak Hash: 0x14515E6A, Count: 1, Total 24 bytes Call Stack (TID 4408): mfc140ud.dll!0x00007FFDCEB931E0() C:\Users\amonra\Documents\GitHub\DSS\ZCLass\Source\ZExcBase.cpp (124): DeepSkyStacker.exe!traceFunction_Lock() + 0xA bytes C:\Users\amonra\Documents\GitHub\DSS\ZCLass\Source\ZExcBase.cpp (596): DeepSkyStacker.exe!ZException::setTraceFunction() + 0x5 bytes C:\Users\amonra\Documents\GitHub\DSS\ZCLass\Source\ZTrace.cpp (173): DeepSkyStacker.exe!ZTrace_Init::ZTrace_Init() C:\Users\amonra\Documents\GitHub\DSS\ZCLass\Source\ZTrace.cpp (202): DeepSkyStacker.exe!ZTraceSetup::traceOn() + 0x21 bytes C:\Users\amonra\Documents\GitHub\DSS\ZCLass\Source\ZTrace.cpp (232): DeepSkyStacker.exe!ZTrace::ZTrace() + 0x5 bytes C:\Users\amonra\Documents\GitHub\DSS\DeepSkyStacker\DeepSkyStacker.cpp (931): DeepSkyStacker.exe!main() + 0x21 bytes C:\Users\qt\work\qt\qtbase\src\entrypoint\qtentrypoint_win.cpp (50): DeepSkyStacker.exe!qtEntryPoint() + 0xE bytes C:\Users\qt\work\qt\qtbase\src\entrypoint\qtentrypoint_win.cpp (60): 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() + 0x1D bytes ntdll.dll!RtlUserThreadStart() + 0x28 bytes Data: A8 C7 A9 40 01 00 00 00 00 00 00 00 00 00 00 00 ...@.... ........ B0 02 00 00 00 00 00 00 ........ ........Instead all I see is:
---------- Block 9961 at 0x000000000A27EE40: 128 bytes ---------- Leak Hash: 0x9C7787F5, Count: 1, Total 128 bytes Call Stack (TID 4408): Data: D0 1C 16 0A 00 00 00 00 D0 26 35 0A 00 00 00 00 ........ .&5..... 20 1E 16 0A 00 00 00 00 90 22 15 0A 00 00 00 00 ........ ."...... 90 1B 35 0A 00 00 00 00 50 32 15 0A 00 00 00 00 ..5..... P2...... 70 2A 15 0A 00 00 00 00 40 21 15 0A 00 00 00 00 p*...... @!...... 50 1C 35 0A 00 00 00 00 20 22 15 0A 00 00 00 00 P.5..... ."...... A0 2C 15 0A 00 00 00 00 F0 3B 15 0A 00 00 00 00 .,...... .;...... B0 1C 35 0A 00 00 00 00 20 29 15 0A 00 00 00 00 ..5..... .)...... 30 33 15 0A 00 00 00 00 30 2C 15 0A 00 00 00 00 03...... 0,......which looks like an array or vector of 16 pointers. Without a call stack its a bit hard to track down.
Does anyone recognise where that might come from?
@Perdrix This is from a debug build right?
Sorry I'm familiar with outputs from asan on Linux but not on Windows. Just wanted to say that I often get leaks detected in: fontconfig and in nVidia graphics drivers. Fontconfig probably won't apply here but maybe nVidia has the same leaks on Windows? In such case there is nothing you can do about it (but also: it's not your bug :-) ).
-
@Perdrix This is from a debug build right?
Sorry I'm familiar with outputs from asan on Linux but not on Windows. Just wanted to say that I often get leaks detected in: fontconfig and in nVidia graphics drivers. Fontconfig probably won't apply here but maybe nVidia has the same leaks on Windows? In such case there is nothing you can do about it (but also: it's not your bug :-) ).
-
OK, then make sure you have Qt installed with "Qt Debug Information Files" selected in Qt Maintenance Tool.
If the problem persists then I have no idea :-(
-
OK, then make sure you have Qt installed with "Qt Debug Information Files" selected in Qt Maintenance Tool.
If the problem persists then I have no idea :-(
@sierdzio I managed to get an stack trace by changing the vld.ini file to log in Unicode and to a file, instead of in ascii to the debugger.
That did produce the necessary stack trace! The leak turned out to be a "ui" object that belonged to a QDialog that was created with the application QMainWindow (which was a stack object in main()) as its parent.
I don't understand why that was done rather then making the object that created it the parent (I need to discuss that with the developer).
I don't quite understand why it wasn't cleaned up when the QMainWindow went out of scope at the end of main().
Thanks all,
David -
S sierdzio has marked this topic as solved on